aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/theme/ThemeFunctions.cpp
diff options
context:
space:
mode:
authorGravatar Noldor2011-03-16 21:58:18 +0000
committerGravatar Noldor2011-03-16 21:58:18 +0000
commitb9d79d0d368cccd31e0c00062b3fb3a26da3b1b8 (patch)
tree7ec35a1438f8441ec6076e475992a4fa79651701 /src/modules/theme/ThemeFunctions.cpp
parentupd8 spanish translation (diff)
downloadKVIrc-b9d79d0d368cccd31e0c00062b3fb3a26da3b1b8.tar.gz
KVIrc-b9d79d0d368cccd31e0c00062b3fb3a26da3b1b8.tar.bz2
KVIrc-b9d79d0d368cccd31e0c00062b3fb3a26da3b1b8.zip
Code improvements in the theme manager(wip)
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5610 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/theme/ThemeFunctions.cpp')
-rw-r--r--src/modules/theme/ThemeFunctions.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/modules/theme/ThemeFunctions.cpp b/src/modules/theme/ThemeFunctions.cpp
index a24684c7b..271fef739 100644
--- a/src/modules/theme/ThemeFunctions.cpp
+++ b/src/modules/theme/ThemeFunctions.cpp
@@ -64,6 +64,7 @@ namespace ThemeFunctions
if(!r.readHeader(szThemePackageFileName))
{
+ qDebug("The selected file does not seem to be a valid KVIrc package");
QString szErr = r.lastError();
szError = QString(__tr2qs_ctx("The selected file does not seem to be a valid KVIrc package: %1","theme")).arg(szErr);
return false;
@@ -72,8 +73,10 @@ namespace ThemeFunctions
pInfoFields = r.stringInfoFields();
pValue = pInfoFields->find("PackageType");
- if(!pValue)
+ if(!pValue){
+ qDebug("no package type");
return notAValidThemePackage(szError);
+ }
if(!KviQString::equalCI(*pValue,"ThemePack"))
return notAValidThemePackage(szError);
@@ -91,16 +94,22 @@ namespace ThemeFunctions
}
pValue = pInfoFields->find("ThemeCount");
- if(!pValue)
+ if(!pValue){
+ qDebug("no theme count");
return notAValidThemePackage(szError);
+ }
bool bOk;
int iThemeCount = pValue->toInt(&bOk);
- if(!bOk)
+ if(!bOk){
+ qDebug("no theme count 2");
return notAValidThemePackage(szError);
+ }
+ if(iThemeCount < 1){
- if(iThemeCount < 1)
+ qDebug("no theme count 2");
return notAValidThemePackage(szError);
+ }
// ok.. it should be really valid at this point