From 728c3cd887662922ee2db802bd91c9a3a1d032ac Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 18 Dec 2008 01:28:37 +0100 Subject: Adjusted download directory requester --- src/settings.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/settings.cpp') diff --git a/src/settings.cpp b/src/settings.cpp index 355799bd..895a22d9 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -33,6 +33,7 @@ // KDE Includes #include #include +#include // Qt Includes #include @@ -49,6 +50,7 @@ SettingsDialog::SettingsDialog(QWidget *parent) setWindowTitle( i18n("Setting rekonq..") ); setButtons( KDialog::Ok | KDialog::Close | KDialog::Apply ); + kurlrequester->setMode( KFile::Directory ); setModal(true); connect(this, SIGNAL( okClicked() ), this, SLOT( slotOk() ) ); @@ -79,7 +81,7 @@ void SettingsDialog::loadDefaults() m_fixedFont = QFont(fixedFontFamily, fixedFontSize); fixedLabel->setText(QString(QLatin1String("%1 %2")).arg( m_fixedFont.family() ).arg( m_fixedFont.pointSize() )); - downloadsLocation->setText(QDesktopServices::storageLocation(QDesktopServices::DesktopLocation)); + kurlrequester->setUrl( KUrl( "~" ) ); // QDesktopServices::storageLocation(QDesktopServices::DesktopLocation) ); enableJavascript->setChecked(defaultSettings->testAttribute(QWebSettings::JavascriptEnabled)); enablePlugins->setChecked(defaultSettings->testAttribute(QWebSettings::PluginsEnabled)); @@ -109,7 +111,7 @@ void SettingsDialog::loadFromSettings() expireHistory->setCurrentIndex(idx); QString downloadDirectory = group1.readEntry( QString("downloadDirectory") , QString() ); - downloadsLocation->setText(downloadDirectory); + kurlrequester->setUrl( KUrl(downloadDirectory) ); openLinksIn->setCurrentIndex( group1.readEntry( QString("openLinksIn"), openLinksIn->currentIndex() ) ); @@ -185,7 +187,7 @@ void SettingsDialog::saveToSettings() group1.writeEntry(QString("home"), homeLineEdit->text() ); group1.writeEntry(QString("openLinksIn"), openLinksIn->currentIndex() ); - group1.writeEntry(QString("downloadDirectory"), downloadsLocation->text() ); + group1.writeEntry(QString("downloadDirectory"), kurlrequester->url().path() ); int historyExpire = expireHistory->currentIndex(); int idx = -1; -- cgit v1.2.1