[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdesupport/kdewin-installer/shared
From:       Ralf Habacker <Ralf.Habacker () freenet ! de>
Date:       2010-07-24 10:49:11
Message-ID: 20100724104911.06E11AC7E2 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1153967 by habacker:

- InstallerCallConfig: made mirror optional
- InstallerCallConfig: added optional setup filename parameter to constructor
- added const QString toString(CompilerType type
 

 M  +21 -6     misc.cpp  
 M  +12 -11    misc.h  


--- trunk/kdesupport/kdewin-installer/shared/misc.cpp #1153966:1153967
@@ -442,12 +442,24 @@
         return Unspecified;
 }
 
-InstallerCallConfig::InstallerCallConfig() : isLoaded(false)
+const QString toString(CompilerType type)
 {
-    QFileInfo fi(QCoreApplication::applicationFilePath());
-    installerBaseName = fi.baseName();
+    if (type == MSVC9)
+        return "vc90";
+    else if (type == MinGW4)
+        return "mingw4";
+    else if (type == MSVC_X64)
+        return "vc_x64";
+    else
+        return "";
+}
+
+InstallerCallConfig::InstallerCallConfig(const QString &fileName) : isLoaded(false)
+{
+    QFileInfo fi(!fileName.isEmpty() ? fileName : QCoreApplication::applicationFilePath());
+    installerBaseName = fi.completeBaseName();
     QStringList a = installerBaseName.split("-");
-    if (a.size() == 6)
+    if (a.size() >= 5)
     {
         key = a[0];
 
@@ -463,10 +475,13 @@
         if (releaseType == Unspecified)
             releaseType = Stable;
 
-        mirror = a[5].isEmpty() && a[5] != QLatin1String("*") ? a[5] : "www.winkde.org";
-    }
+        if (a.size() == 5 || a[5].isEmpty())
+            mirror = "www.winkde.org";
+        else if (a[5] != QLatin1String("*"))
+            mirror = a[5];
     isLoaded = true;
 }
+}
 
 /*
  setup-<packageName>-[<compiler]-[<version>]-[<releaseType>]-[<mirror>].exe
--- trunk/kdesupport/kdewin-installer/shared/misc.h #1153966:1153967
@@ -38,6 +38,7 @@
 
 typedef enum { Unspecified=0, MinGW=1, MSVC = 2, MSVC8=2, MSVC9=3, MinGW4=4, MSVC_X64=5 } CompilerType;
 CompilerType toCompilerType(const QString &type); 
+const QString toString(CompilerType compilerType);
 
 
 struct InstallFile
@@ -96,29 +97,29 @@
 bool isX64Windows();
 
 
-// setup-<packageName>-<releaseType>-<version>[-<mirror>].exe
 /**
- InstallerCallConfig provides predefined informations from the 
- installer filename to skip related wizard pages. In detail 
- these informations are 
+ InstallerCallConfig provides package related informations from the 
+ installer filename which could be used to skip related wizard pages 
+ or to implement specific gui applications. 
  
- - which package to install (skip package selecting page)
- - which release type and version (skip release selecting page)
- - which compiler (skip compiler selecting page)
- - which download server (skip download server selecting page)
+ - which package to install (e.g. umbrello)
+ - which compiler (e.g vc90, mingw4)
+ - which release type (e.g. stable,nightly,unstable)
+ - which release version (e.g. 4.4.4)
+ - which download server
  
  The filename has to build in the following manner: 
 
-    setup-<packageName>-[<compiler]-[<version>]-[<releaseType>]-[<mirror>].exe
+    setup-<packageName>-<compiler>-<version>-<releaseType>[-<mirror>].exe
 
-  each part could be skipped by leaving the related field empty 
+  parts in [] are optional
 
   @todo move to separate file or a more descriptive place
 */
 
 class InstallerCallConfig {
 public:
-    InstallerCallConfig();
+    InstallerCallConfig(const QString &fileName=QString());
     bool isValid() { return key == "setup"; }
 
     static InstallerCallConfig &instance(); 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic