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

List:       kde-commits
Subject:    KDE/kdepim/akonadi/tray
From:       Tom Albers <tomalbers () kde ! nl>
Date:       2008-04-09 18:44:32
Message-ID: 1207766672.532244.15574.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 795303 by toma:

Use the same keyword in backup and restore, so it opens in the same folder. For the \
backup also provide a suggested filename. That means we can not use a static function \
of KFileDialog.


 M  +12 -3     backupassistant.cpp  
 M  +1 -1      restoreassistant.cpp  


--- trunk/KDE/kdepim/akonadi/tray/backupassistant.cpp #795302:795303
@@ -71,10 +71,19 @@
 }
 
 void BackupAssistant::slotSelectFile()
-{   
-    QString file = QString( "~/akonadibackup-" + 
+{
+    QString file = QString( "akonadibackup-" + 
         QDateTime::currentDateTime().toString( "yyyyMMdd" )  + ".tgz" );
-    m_filename = KFileDialog::getSaveFileName( KUrl( file ) );
+
+    // Build one special, as we want the keyword /and/ a proposed filename
+    KFileDialog dlg( KUrl(  "kfiledialog://BackupDir" ), QString(), this );
+    dlg.setSelection( file );
+    dlg.setOperationMode(  KFileDialog::Saving );
+    dlg.setMode(  KFile::File );
+    dlg.setWindowTitle( i18n( "Save As" ) );
+    dlg.exec();
+
+    m_filename = dlg.selectedFile();
     if ( !m_filename.isEmpty() ) {
         m_selectFileButton->setText( m_filename );
         setValid( m_page1, true );
--- trunk/KDE/kdepim/akonadi/tray/restoreassistant.cpp #795302:795303
@@ -73,7 +73,7 @@
 
 void RestoreAssistant::slotSelectFile()
 {
-    m_filename = KFileDialog::getOpenFileName( KUrl( "~/akonadibackup.tgz" ) );
+    m_filename = KFileDialog::getOpenFileName( KUrl( "kfiledialog://BackupDir" ) );
     if ( !m_filename.isEmpty() ) {
         m_selectFileButton->setText( m_filename );
         setValid( m_page1, true );


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

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