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

List:       kde-commits
Subject:    branches/KDE/4.0/kdebase/workspace/kcontrol/colors
From:       Harald Sitter <sitter.harald () gmail ! com>
Date:       2008-01-29 21:06:07
Message-ID: 1201640767.832756.6841.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 768354 by sitter:

backport of revision 768353
  fix crash when no file gets supplied (i.e. cancel is pressed)


 M  +10 -7     colorscm.cpp  


--- branches/KDE/4.0/kdebase/workspace/kcontrol/colors/colorscm.cpp #768353:768354
@@ -286,15 +286,18 @@
     // get the path to the scheme to import
     KUrl url = KFileDialog::getOpenUrl(KUrl(), QString(), this, i18n("Import Color Scheme"));
 
-    // TODO: possibly untar or uncompress it
-    // open it
+    if(url.isValid())
+    {
+        // TODO: possibly untar or uncompress it
+        // open it
 
-    // load the scheme
-    KSharedConfigPtr config = KSharedConfig::openConfig(url.path());
-    loadScheme(config);
+        // load the scheme
+        KSharedConfigPtr config = KSharedConfig::openConfig(url.path());
+        loadScheme(config);
 
-    // save it
-    saveScheme(url.fileName());
+        // save it
+        saveScheme(url.fileName());
+    }
 }
 
 void KColorCm::on_schemeSaveButton_clicked()
[prev in list] [next in list] [prev in thread] [next in thread] 

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