mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-24 10:52:53 +00:00
filelight: use the static KFileDialog::getExistingDirectoryUrl() method
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
f6fd57439d
commit
4038966ad0
1 changed files with 4 additions and 10 deletions
|
@ -152,16 +152,10 @@ void SettingsDialog::toggleDontScanRemovableMedia(bool b)
|
||||||
|
|
||||||
void SettingsDialog::addFolder()
|
void SettingsDialog::addFolder()
|
||||||
{
|
{
|
||||||
KFileDialog dlg(KUrl(QDir::rootPath()), QString(), this);
|
const KUrl url = KFileDialog::getExistingDirectoryUrl(
|
||||||
dlg.setOperationMode(KFileDialog::Opening);
|
KUrl(QDir::rootPath()), this,
|
||||||
dlg.setMode(KFile::Directory | KFile::ExistingOnly);
|
i18n("Select Folder to Scan")
|
||||||
dlg.setCaption(i18n( "Select Folder to Scan" ));
|
);
|
||||||
dlg.exec();
|
|
||||||
const KUrl url = dlg.selectedUrl();
|
|
||||||
|
|
||||||
//TODO error handling!
|
|
||||||
//TODO wrong protocol handling!
|
|
||||||
|
|
||||||
if (!url.isEmpty())
|
if (!url.isEmpty())
|
||||||
{
|
{
|
||||||
const QString path = url.path(KUrl::AddTrailingSlash);
|
const QString path = url.path(KUrl::AddTrailingSlash);
|
||||||
|
|
Loading…
Add table
Reference in a new issue