aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/theme/ThemeFunctions.cpp
diff options
context:
space:
mode:
authorGravatar Matt Ullman2015-10-18 05:16:18 -0400
committerGravatar Matt Ullman2015-10-18 05:17:31 -0400
commite227679b0af3687acf9292953edbb0ebeab19df9 (patch)
treeb498cd485b2cf65cd6e4288ba75beb3ba6e89e02 /src/modules/theme/ThemeFunctions.cpp
parentMerge pull request #1674 from un1versal/The-Emperor's-New-Clothes (diff)
downloadKVIrc-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/theme/ThemeFunctions.cpp')
-rw-r--r--src/modules/theme/ThemeFunctions.cpp29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/modules/theme/ThemeFunctions.cpp b/src/modules/theme/ThemeFunctions.cpp
index e0542534e..c1e464049 100644
--- a/src/modules/theme/ThemeFunctions.cpp
+++ b/src/modules/theme/ThemeFunctions.cpp
@@ -381,7 +381,7 @@ namespace ThemeFunctions
g_pMainWindow->showNormal();
return bResult;
}
-
+
bool packageThemes(
const QString &szPackagePath,
@@ -416,15 +416,15 @@ namespace ThemeFunctions
szError = __tr2qs_ctx("Failed to load the selected image: please fix it","theme");
return false;
}
-
+
if((pix.width() > 300) || (pix.height() > 225))
out = out.fromImage(pix.scaled(300,225,Qt::KeepAspectRatio));
else
out=out.fromImage(pix);
}
-
+
KviPackageWriter f;
-
+
f.addInfoField("PackageType","ThemePack");
f.addInfoField("ThemePackVersion",KVI_CURRENT_THEME_ENGINE_VERSION);
f.addInfoField("Name",szPackageName);
@@ -435,7 +435,7 @@ namespace ThemeFunctions
// to ensure qt4 will use the default() locale and not the system() one
f.addInfoField("Date",QDateTime::currentDateTime().toString(Qt::ISODate));
f.addInfoField("Application","KVIrc " KVI_VERSION "." KVI_SOURCES_DATE);
-
+
if(!out.isNull())
{
QByteArray * pba = new QByteArray();
@@ -445,12 +445,12 @@ namespace ThemeFunctions
buffer.close();
f.addInfoField("Image",pba); // cool :) [no disk access needed]
}
-
+
QString szTmp;
-
+
szTmp.setNum(lThemeInfoList.count());
f.addInfoField("ThemeCount",szTmp);
-
+
int iIdx = 0;
for(KviThemeInfo * pInfo = lThemeInfoList.first();pInfo;pInfo = lThemeInfoList.next())
{
@@ -464,10 +464,10 @@ namespace ThemeFunctions
szError = __tr2qs_ctx("Invalid theme version","theme");
return false;
}
-
+
QString szSubdir = pInfo->name() + QString("-") + pInfo->version();
szSubdir.replace(QRegExp("[^a-zA-Z0-9_\\-.][^a-zA-Z0-9_\\-.]*"),"_");
-
+
szTmp = QString("Theme%1Name").arg(iIdx);
f.addInfoField(szTmp,pInfo->name());
szTmp = QString("Theme%1Version").arg(iIdx);
@@ -489,7 +489,7 @@ namespace ThemeFunctions
{
szTmp = QString("Theme%1Screenshot").arg(iIdx);
QByteArray * pba = new QByteArray();
-
+
QBuffer bufferz(pba,0);
bufferz.open(QIODevice::WriteOnly);
pixScreenshot.save(&bufferz,"PNG");
@@ -504,10 +504,10 @@ namespace ThemeFunctions
szError += f.lastError();
return false;
}
-
+
iIdx++;
}
-
+
if(!f.pack(szPackagePath))
{
szError = __tr2qs_ctx("Packaging failed","theme");
@@ -515,8 +515,7 @@ namespace ThemeFunctions
szError += f.lastError();
return false;
}
-
+
return true;
}
}
-