aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/theme/themefunctions.cpp
diff options
context:
space:
mode:
authorGravatar Noldor2010-04-03 10:19:17 +0000
committerGravatar Noldor2010-04-03 10:19:17 +0000
commitbe98ee1c2a1d4f8f2e14276ef8aa19487c033bd1 (patch)
tree321511f2bea3cb028eeca48c8db2e89ac35bad62 /src/modules/theme/themefunctions.cpp
parentFixed removing items in logview (diff)
downloadKVIrc-be98ee1c2a1d4f8f2e14276ef8aa19487c033bd1.tar.gz
KVIrc-be98ee1c2a1d4f8f2e14276ef8aa19487c033bd1.tar.bz2
KVIrc-be98ee1c2a1d4f8f2e14276ef8aa19487c033bd1.zip
Improvements in theme manager (by hellvis - code cleaning by CtrlAltCa & Noldor)
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4234 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/theme/themefunctions.cpp')
-rw-r--r--src/modules/theme/themefunctions.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/modules/theme/themefunctions.cpp b/src/modules/theme/themefunctions.cpp
index 955398099..dc3052663 100644
--- a/src/modules/theme/themefunctions.cpp
+++ b/src/modules/theme/themefunctions.cpp
@@ -61,8 +61,10 @@ namespace KviThemeFunctions
// check if it is a valid theme file
KviPackageReader r;
+ debug("check file");
if(!r.readHeader(szThemePackageFileName))
{
+ debug("Error!");
QString szErr = r.lastError();
KviQString::sprintf(szError,__tr2qs_ctx("The selected file does not seem to be a valid KVIrc package: %Q","theme"),&szErr);
return false;
@@ -72,12 +74,16 @@ namespace KviThemeFunctions
pValue = pInfoFields->find("PackageType");
if(!pValue)return notAValidThemePackage(szError);
+ debug("pValue themepack= %s",pValue->toUtf8().data());
if(!KviQString::equalCI(*pValue,"ThemePack"))return notAValidThemePackage(szError);
pValue = pInfoFields->find("ThemePackVersion");
+ debug("pValue theme version %s",pValue->toUtf8().data());
+
if(!pValue)return notAValidThemePackage(szError);
- if(!KviQString::equalCI(*pValue,"1"))return notAValidThemePackage(szError);
+ if(!KviQString::equalCI(*pValue,KVI_CURRENT_THEME_ENGINE_VERSION))return notAValidThemePackage(szError);
// make sure the default fields exist
+ debug("check defaults fields");
for(int i=0;i<6;i++)
{
pValue = pInfoFields->find(check_fields[i]);
@@ -85,6 +91,7 @@ namespace KviThemeFunctions
}
pValue = pInfoFields->find("ThemeCount");
+ debug("pValue theme count %s",pValue->toUtf8().data());
if(!pValue)return notAValidThemePackage(szError);
bool bOk;
int iThemeCount = pValue->toInt(&bOk);
@@ -277,11 +284,12 @@ namespace KviThemeFunctions
hd.iFlags = KviHtmlDialogData::ForceMinimumSize;
bInstall = KviHtmlDialog::display(pDialogParent,&hd) == 2;
-
+ debug("installint %d",bInstall);
if(bInstall)
{
QString szUnpackPath;
g_pApp->getLocalKvircDirectory(szUnpackPath,KviApp::Themes);
+ debug("unpack theme %s in %s",szThemePackageFileName.toUtf8().data(),szUnpackPath.toUtf8().data());
if(!r.unpack(szThemePackageFileName,szUnpackPath))
{
QString szErr2 = r.lastError();