From b9d79d0d368cccd31e0c00062b3fb3a26da3b1b8 Mon Sep 17 00:00:00 2001 From: Noldor Date: Wed, 16 Mar 2011 21:58:18 +0000 Subject: Code improvements in the theme manager(wip) git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5610 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/theme/ThemeFunctions.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/modules/theme/ThemeFunctions.cpp') 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 -- cgit v1.3.1-10-gc9f91