diff options
| author | 2015-10-18 05:16:18 -0400 | |
|---|---|---|
| committer | 2015-10-18 05:17:31 -0400 | |
| commit | e227679b0af3687acf9292953edbb0ebeab19df9 (patch) | |
| tree | b498cd485b2cf65cd6e4288ba75beb3ba6e89e02 /src/modules/addon/AddonFunctions.cpp | |
| parent | Merge pull request #1674 from un1versal/The-Emperor's-New-Clothes (diff) | |
| download | KVIrc-e227679b0af3687acf9292953edbb0ebeab19df9.tar.gz KVIrc-e227679b0af3687acf9292953edbb0ebeab19df9.tar.bz2 KVIrc-e227679b0af3687acf9292953edbb0ebeab19df9.zip | |
Clean up trailing whitespaces and excess newlines
Oh how I can already hear the sound of angry villagers
with pitchforks running over to my desk
Diffstat (limited to 'src/modules/addon/AddonFunctions.cpp')
| -rw-r--r-- | src/modules/addon/AddonFunctions.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/modules/addon/AddonFunctions.cpp b/src/modules/addon/AddonFunctions.cpp index c0f68dabf..815d35334 100644 --- a/src/modules/addon/AddonFunctions.cpp +++ b/src/modules/addon/AddonFunctions.cpp @@ -268,29 +268,29 @@ namespace AddonFunctions return szDirName; } - + bool checkDirTree(const QString &szDirPath,QString * pszError) { if(pszError) *pszError = ""; - + QDir addon(szDirPath); if(!addon.exists()) { *pszError = __tr2qs_ctx("The selected directory does not exist.","addon"); return false; } - + QFileInfo init(szDirPath + "/install.kvs"); if(!init.exists()) { *pszError = __tr2qs_ctx("The initialization script (install.kvs) does not exist.","addon"); return false; } - + return true; } - + bool pack(AddonInfo &info,QString &szError) { if(!checkDirTree(info.szDirPath,&szError)) @@ -301,7 +301,7 @@ namespace AddonFunctions QString szTmp; szTmp = QDateTime::currentDateTime().toString(Qt::ISODate); - + KviPackageWriter pw; pw.addInfoField("PackageType","AddonPack"); pw.addInfoField("AddonPackVersion",KVI_CURRENT_ADDONS_ENGINE_VERSION); @@ -324,26 +324,26 @@ namespace AddonFunctions QByteArray * pba = new QByteArray(); QBuffer bufferz(pba,0); - + bufferz.open(QIODevice::WriteOnly); pix.save(&bufferz,"PNG"); bufferz.close(); pw.addInfoField("Image",pba); } - + QDir dir(info.szDirPath); QFileInfoList ls = dir.entryInfoList(QDir::Dirs | QDir::Files | QDir::Readable | QDir::NoSymLinks | QDir::NoDotAndDotDot); - + if(ls.isEmpty()) { szError = __tr2qs_ctx("The package file list is empty","addon"); return false; } - + for(QFileInfoList::Iterator it = ls.begin();it != ls.end();++it) { const QFileInfo &inf = *it; - + if(inf.isDir()) { if(!pw.addDirectory(inf.absoluteFilePath(),QString("%1/").arg(inf.fileName()))) @@ -351,10 +351,10 @@ namespace AddonFunctions szError = pw.lastError(); return false; } - + continue; } - + // must be a file if(!pw.addFile(inf.absoluteFilePath(),inf.fileName())) { @@ -362,15 +362,15 @@ namespace AddonFunctions return false; } } - - + + // Create the addon package if(info.szSavePath.isEmpty()) { szError = __tr2qs_ctx("Save path is empty","addon"); return false; } - + if(!pw.pack(info.szSavePath)) { szError = pw.lastError(); @@ -379,5 +379,5 @@ namespace AddonFunctions return true; } - + } |
