aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/theme/themefunctions.cpp
diff options
context:
space:
mode:
authorGravatar Szymon Tomasz Stefanek2010-06-26 01:28:32 +0000
committerGravatar Szymon Tomasz Stefanek2010-06-26 01:28:32 +0000
commit01f27e10bbac962109588fec477ef92237cf569b (patch)
treedb9885fb1f36dbf2f9ec8395cf7fd39bf9598be7 /src/modules/theme/themefunctions.cpp
parentupdate (diff)
downloadKVIrc-01f27e10bbac962109588fec477ef92237cf569b.tar.gz
KVIrc-01f27e10bbac962109588fec477ef92237cf569b.tar.bz2
KVIrc-01f27e10bbac962109588fec477ef92237cf569b.zip
Rework the addon pack dialog.
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4520 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/theme/themefunctions.cpp')
-rw-r--r--src/modules/theme/themefunctions.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/modules/theme/themefunctions.cpp b/src/modules/theme/themefunctions.cpp
index 3890ef68d..a1a39a991 100644
--- a/src/modules/theme/themefunctions.cpp
+++ b/src/modules/theme/themefunctions.cpp
@@ -61,10 +61,9 @@ 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;
@@ -73,16 +72,18 @@ namespace KviThemeFunctions
pInfoFields = r.stringInfoFields();
pValue = pInfoFields->find("PackageType");
- if(!pValue)return notAValidThemePackage(szError);
- debug("pValue themepack= %s",pValue->toUtf8().data());
- if(!KviQString::equalCI(*pValue,"ThemePack"))return notAValidThemePackage(szError);
+ if(!pValue)
+ return notAValidThemePackage(szError);
+
+ 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(!pValue)
+ 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]);
@@ -90,12 +91,16 @@ namespace KviThemeFunctions
}
pValue = pInfoFields->find("ThemeCount");
- debug("pValue theme count %s",pValue->toUtf8().data());
- if(!pValue)return notAValidThemePackage(szError);
+ if(!pValue)
+ return notAValidThemePackage(szError);
+
bool bOk;
int iThemeCount = pValue->toInt(&bOk);
- if(!bOk)return notAValidThemePackage(szError);
- if(iThemeCount < 1)return notAValidThemePackage(szError);
+ if(!bOk)
+ return notAValidThemePackage(szError);
+
+ if(iThemeCount < 1)
+ return notAValidThemePackage(szError);
// ok.. it should be really valid at this point
@@ -283,12 +288,10 @@ 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();