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

List:       kde-commits
Subject:    branches/work/kde4/kdelibs/kio/kfile
From:       Joseph Wenninger <kde () jowenn ! at>
Date:       2005-06-09 21:17:45
Message-ID: 1118351865.176205.7918.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 423840 by jowenn:

don't run into too many asserts and display a usefull file dialog when called with \
getOpenURL, not only when uses as getOpenURLs

 M  +1 -1      kdiroperator.cpp  
 M  +3 -3      kfiledialog.cpp  


--- branches/work/kde4/kdelibs/kio/kfile/kdiroperator.cpp #423839:423840
@@ -102,7 +102,7 @@
       progress(0)
 {
     myPreview = 0L;
-    myMode = KFile::File;
+    myMode = KFile::ModeMax; //try to make KFileDialog::getOpenURL (without s) to \
work again  m_viewKind = KFile::Simple;
     mySorting = static_cast<QDir::SortSpec>(QDir::Name | QDir::DirsFirst);
     d = new KDirOperatorPrivate;
--- branches/work/kde4/kdelibs/kio/kfile/kfiledialog.cpp #423839:423840
@@ -1577,7 +1577,7 @@
                                      QWidget *parent,
                                      const QString& caption)
 {
-    bool specialDir = dir.at(0) == ':';
+    bool specialDir = (!dir.isEmpty()) && (dir.at(0) == ':');
     KFileDialog dlg( specialDir ? dir : QString::null, filter, parent, "filedialog", \
true);  if ( !specialDir )
         dlg.setSelection( dir ); // may also be a filename
@@ -1598,7 +1598,7 @@
                                      WId parent_id,
                                      const QString& caption)
 {
-    bool specialDir = dir.at(0) == ':';
+    bool specialDir = (!dir.isEmpty()) && (dir.at(0) == ':');
     QWidget* parent = QWidget::find( parent_id );
     KFileDialog dlg( specialDir ? dir : QString::null, filter, parent, "filedialog", \
true);  #ifdef Q_WS_X11
@@ -1626,7 +1626,7 @@
 KURL KFileDialog::getSaveURL(const QString& dir, const QString& filter,
                              QWidget *parent, const QString& caption)
 {
-    bool specialDir = dir.at(0) == ':';
+    bool specialDir = (!dir.isEmpty()) && (dir.at(0) == ':');
     KFileDialog dlg(specialDir ? dir : QString::null, filter, parent, "filedialog", \
true);  if ( !specialDir )
     dlg.setSelection( dir ); // may also be a filename


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

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