[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:18:22 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=536af2d
The following commit has been merged in the master branch:
commit 536af2db60bcc8fb60aaade837f0e7227d99a152
Author: Dominik Schmidt <ich at dominik-schmidt.de>
Date: Mon Oct 4 00:57:51 2010 +0000
Sanitized BundleInstaller API and changed EmoticonsetInstaller and ChatstyleInstaller to use it.
svn path=/trunk/playground/network/telepathy-chat-handler/; revision=1182265
---
adiumxtra-protocol-handler/bundleinstaller.h | 7 +++----
adiumxtra-protocol-handler/chatstyleinstaller.cpp | 19 ++++++++-----------
adiumxtra-protocol-handler/chatstyleinstaller.h | 4 ++--
adiumxtra-protocol-handler/emoticonsetinstaller.cpp | 11 +++++------
adiumxtra-protocol-handler/emoticonsetinstaller.h | 4 ++--
5 files changed, 20 insertions(+), 25 deletions(-)
diff --git a/adiumxtra-protocol-handler/bundleinstaller.h b/adiumxtra-protocol-handler/bundleinstaller.h
index da4fbc3..863cc9a 100644
--- a/adiumxtra-protocol-handler/bundleinstaller.h
+++ b/adiumxtra-protocol-handler/bundleinstaller.h
@@ -1,8 +1,6 @@
#ifndef BUNDLEINSTALLER_H
#define BUNDLEINSTALLER_H
-#include "bundleinstaller.cpp"
-
#include <KArchive>
#include <KDebug>
@@ -11,7 +9,8 @@ class BundleInstaller : public QObject
Q_OBJECT
public:
- virtual bool validate() = 0;
+ enum BundleStatus { BundleInstallOk = 0, BundleNotValid, BundleNoDirectoryValid, BundleCannotOpen, BundleUnknownError, BundleValid };
+ virtual BundleStatus validate() = 0;
virtual QString bundleName() = 0;
virtual ~BundleInstaller(){ kDebug(); };
@@ -19,7 +18,7 @@ class BundleInstaller : public QObject
void finished();
public Q_SLOTS:
- virtual bool install() = 0;
+ virtual BundleStatus install() = 0;
};
#endif // BUNDLEINSTALLER_H
diff --git a/adiumxtra-protocol-handler/chatstyleinstaller.cpp b/adiumxtra-protocol-handler/chatstyleinstaller.cpp
index 279b086..2dab8a8 100644
--- a/adiumxtra-protocol-handler/chatstyleinstaller.cpp
+++ b/adiumxtra-protocol-handler/chatstyleinstaller.cpp
@@ -14,7 +14,7 @@ ChatStyleInstaller::ChatStyleInstaller(KArchive *archive, KTemporaryFile *tmpFil
m_tmpFile = tmpFile;
}
-bool ChatStyleInstaller::validate()
+BundleInstaller::BundleStatus ChatStyleInstaller::validate()
{
kDebug();
@@ -37,7 +37,8 @@ bool ChatStyleInstaller::validate()
if (currentDir->entry(QString::fromUtf8("Contents/Info.plist"))) {
kDebug() << "Contents/Info.plist found";
KArchiveFile const *info = dynamic_cast<KArchiveFile const *>(currentDir->entry(QString::fromUtf8("Contents/Info.plist")));
- ChatStylePlistFileReader reader(info->data());
+ QByteArray data = info->data();
+ ChatStylePlistFileReader reader(data);
if(m_bundleName.isEmpty()) {
m_bundleName = reader.CFBundleName();
}
@@ -48,9 +49,9 @@ bool ChatStyleInstaller::validate()
}
if(validResult >= 2) {
- return true;
+ return BundleValid;
} else {
- return false;
+ return BundleValid;
}
}
@@ -61,19 +62,15 @@ QString ChatStyleInstaller::bundleName()
return m_bundleName;
}
-bool ChatStyleInstaller::install()
+BundleInstaller::BundleStatus ChatStyleInstaller::install()
{
kDebug();
- int status = ChatWindowStyleManager::self()->installStyle(m_archive->fileName());
+ BundleInstaller::BundleStatus status = static_cast<BundleInstaller::BundleStatus>(ChatWindowStyleManager::self()->installStyle(m_archive->fileName()));
kDebug()<< "status " << status;
delete(m_tmpFile);
emit(finished());
- if(!status) {
- return true;
- } else {
- return false;
- }
+ return status;
}
diff --git a/adiumxtra-protocol-handler/chatstyleinstaller.h b/adiumxtra-protocol-handler/chatstyleinstaller.h
index 0323218..2d0f657 100644
--- a/adiumxtra-protocol-handler/chatstyleinstaller.h
+++ b/adiumxtra-protocol-handler/chatstyleinstaller.h
@@ -13,12 +13,12 @@ class ChatStyleInstaller : public BundleInstaller
public:
ChatStyleInstaller(KArchive *archive, KTemporaryFile *tmpFile);
- bool validate();
+ BundleInstaller::BundleStatus validate();
QString bundleName();
~ChatStyleInstaller() { kDebug(); };
public Q_SLOTS:
- bool install();
+ BundleInstaller::BundleStatus install();
private:
KArchive *m_archive;
diff --git a/adiumxtra-protocol-handler/emoticonsetinstaller.cpp b/adiumxtra-protocol-handler/emoticonsetinstaller.cpp
index b4cb354..e11ebd7 100644
--- a/adiumxtra-protocol-handler/emoticonsetinstaller.cpp
+++ b/adiumxtra-protocol-handler/emoticonsetinstaller.cpp
@@ -16,7 +16,7 @@ EmoticonSetInstaller::EmoticonSetInstaller(KArchive *archive, KTemporaryFile *tm
m_tmpFile = tmpFile;
}
-bool EmoticonSetInstaller::validate()
+BundleInstaller::BundleStatus EmoticonSetInstaller::validate()
{
kDebug();
@@ -26,7 +26,6 @@ bool EmoticonSetInstaller::validate()
m_archive->fileName();
m_archive->directory();
const KArchiveDirectory* rootDir = m_archive->directory();
- int validResult = 0;
const QStringList entries = rootDir->entries();
// Will be reused later.
QStringList::ConstIterator entriesIt, entriesItEnd = entries.end();
@@ -42,13 +41,13 @@ bool EmoticonSetInstaller::validate()
if(m_bundleName.isEmpty() && currentItem.endsWith(".AdiumEmoticonset")) {
m_bundleName = currentItem.remove(".AdiumEmoticonset");
}
- return true;
+ return BundleValid;
}
}
}
}
- return false;
+ return BundleNotValid;
}
QString EmoticonSetInstaller::bundleName()
@@ -58,7 +57,7 @@ QString EmoticonSetInstaller::bundleName()
return m_bundleName;
}
-bool EmoticonSetInstaller::install()
+BundleInstaller::BundleStatus EmoticonSetInstaller::install()
{
kDebug();
@@ -66,5 +65,5 @@ bool EmoticonSetInstaller::install()
emoticons.installTheme(m_tmpFile->fileName());
emit(finished());
- return true;
+ return BundleInstallOk;
}
diff --git a/adiumxtra-protocol-handler/emoticonsetinstaller.h b/adiumxtra-protocol-handler/emoticonsetinstaller.h
index 8bf46d6..7f20470 100644
--- a/adiumxtra-protocol-handler/emoticonsetinstaller.h
+++ b/adiumxtra-protocol-handler/emoticonsetinstaller.h
@@ -13,12 +13,12 @@ class EmoticonSetInstaller : public BundleInstaller
public:
EmoticonSetInstaller(KArchive *archive, KTemporaryFile *tmpFile);
- bool validate();
+ BundleStatus validate();
QString bundleName();
~EmoticonSetInstaller() { kDebug(); };
public Q_SLOTS:
- bool install();
+ BundleStatus install();
private:
KArchive *m_archive;
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list