Bug 240645 - Graphical path picker in dialog to handle unwritable destination path upon accepting transfer is broken
Summary: Graphical path picker in dialog to handle unwritable destination path upon ac...
Status: RESOLVED FIXED
Alias: None
Product: konversation
Classification: Applications
Component: dcc (show other bugs)
Version: Git
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Bernd Buschinski
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-03 21:09 UTC by Eike Hein
Modified: 2010-07-01 16:15 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eike Hein 2010-06-03 21:09:58 UTC
If the preferences contain a download destination path that does not exist, Konversation will attempt to create that folder upon accepting a transfer. If there is insufficient privilege to create the folder, it will further display a dialog box asking the user to specify a new destination path.

This dialog contains a text input field for the new destination path that shows the originally intended path along with the original filename. Next to the field is a "Browse" button to pick a new directory. There are two problems with the dialog invoked by "Browse":

a) It's not seeded with the original file name by default.

b) After picking a directory and entering a file name and clicking OK, an error dialog with the message 'The file "<specified path with file name" could not be found' is displayed.
Comment 1 Eike Hein 2010-06-04 19:08:54 UTC
commit cc9e57f94d6f52bef4b946c3e5b63eb6a34aed01
Author: Eike Hein <hein@kde.org>
Date:   Fri Jun 4 19:02:36 2010 +0200

    Fix resume dialog file picker complaining about not yet existing paths.
    
    BUG:240645
    
    Also don't lose the file name across directory changes in the file picker.

diff --git a/ChangeLog b/ChangeLog
index 73f2a91..6fad0a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,16 @@ Changes since 1.3-beta1:
   the state of the list control buttons.
 * After adding a new item to one of the server or channel lists in "Edit
   Network" dialogs, that item will now be selected.
+* Fixed a bug causing the file dialog for selecting a new target directory
+  and file name for an incoming DCC file transfer in the event that the
+  default path is not writable to complain about being unable to find the
+  file after clicking "OK" when no file of the chosen name at the chosen
+  location exists already.
+* Fixed a bug causing the file dialog for selecting a new target directory
+  and file name for an incoming DCC file transfer in the event that the
+  default path is not writable to lose the file name written in the "Lo-
+  cation" field (by default, the original file name) when changing the
+  current directory.
 
 
 Changes from 1.2.3 to 1.3-beta1:
diff --git a/src/dcc/resumedialog.cpp b/src/dcc/resumedialog.cpp
index 88c24f6..e4b4963 100644
--- a/src/dcc/resumedialog.cpp
+++ b/src/dcc/resumedialog.cpp
@@ -19,6 +19,7 @@
 #include <QVBoxLayout>
 #include <QHBoxLayout>
 
+#include <KFileDialog>
 #include <KLocale>
 #include <KUrl>
 #include <KUrlRequester>
@@ -80,6 +81,8 @@ namespace Konversation
             labelMessage->setText(message);
 
             m_urlreqFileURL = new KUrlRequester(m_item->getFileURL().prettyUrl(), page);
+            m_urlreqFileURL->setMode(KFile::File | KFile::LocalOnly);
+            m_urlreqFileURL->fileDialog()->setKeepLocation(true);
             connect(m_urlreqFileURL, SIGNAL(textChanged(const QString&)), this, SLOT(updateDialogButtons()));
 
             pageLayout->addWidget(labelMessage);
Comment 2 Eike Hein 2010-07-01 16:15:40 UTC
commit cc9e57f94d6f52bef4b946c3e5b63eb6a34aed01
Author: Eike Hein <hein@kde.org>
Date:   Fri Jun 4 19:02:36 2010 +0200

    Fix resume dialog file picker complaining about not yet existing paths.
    
    BUG:240645
    
    Also don't lose the file name across directory changes in the file picker.

diff --git a/ChangeLog b/ChangeLog
index 73f2a91..6fad0a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,16 @@ Changes since 1.3-beta1:
   the state of the list control buttons.
 * After adding a new item to one of the server or channel lists in "Edit
   Network" dialogs, that item will now be selected.
+* Fixed a bug causing the file dialog for selecting a new target directory
+  and file name for an incoming DCC file transfer in the event that the
+  default path is not writable to complain about being unable to find the
+  file after clicking "OK" when no file of the chosen name at the chosen
+  location exists already.
+* Fixed a bug causing the file dialog for selecting a new target directory
+  and file name for an incoming DCC file transfer in the event that the
+  default path is not writable to lose the file name written in the "Lo-
+  cation" field (by default, the original file name) when changing the
+  current directory.
 
 
 Changes from 1.2.3 to 1.3-beta1:
diff --git a/src/dcc/resumedialog.cpp b/src/dcc/resumedialog.cpp
index 88c24f6..e4b4963 100644
--- a/src/dcc/resumedialog.cpp
+++ b/src/dcc/resumedialog.cpp
@@ -19,6 +19,7 @@
 #include <QVBoxLayout>
 #include <QHBoxLayout>
 
+#include <KFileDialog>
 #include <KLocale>
 #include <KUrl>
 #include <KUrlRequester>
@@ -80,6 +81,8 @@ namespace Konversation
             labelMessage->setText(message);
 
             m_urlreqFileURL = new KUrlRequester(m_item->getFileURL().prettyUrl(), page);
+            m_urlreqFileURL->setMode(KFile::File | KFile::LocalOnly);
+            m_urlreqFileURL->fileDialog()->setKeepLocation(true);
             connect(m_urlreqFileURL, SIGNAL(textChanged(const QString&)), this, SLOT(updateDialogButtons()));
 
             pageLayout->addWidget(labelMessage);