mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
generic: adjust to kfile changes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
3d21491cf0
commit
81f53f5427
3 changed files with 16 additions and 17 deletions
|
@ -12,7 +12,6 @@ qt4_add_dbus_adaptor(kdialog_SRCS
|
|||
|
||||
add_executable(kdialog ${kdialog_SRCS})
|
||||
|
||||
# Need libkfile due to the code that adjusts the geometry of the KDirSelectDialog
|
||||
target_link_libraries(kdialog
|
||||
KDE4::kfile
|
||||
KDE4::kio
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include <kfiledialog.h>
|
||||
#include <kfileitem.h>
|
||||
#include <kicondialog.h>
|
||||
#include <kdirselectdialog.h>
|
||||
#include <kcolordialog.h>
|
||||
#include <kwindowsystem.h>
|
||||
#include <kiconloader.h>
|
||||
|
@ -620,21 +619,20 @@ static int directCommand(KCmdLineArgs *args)
|
|||
if (args->isSet("getexistingdirectory")) {
|
||||
QString startDir;
|
||||
startDir = args->getOption("getexistingdirectory");
|
||||
QString result;
|
||||
KUrl url;
|
||||
KDirSelectDialog myDialog( startDir, true, 0 );
|
||||
QString result;
|
||||
KFileDialog dlg( startDir, QString(), 0 );
|
||||
dlg.setOperationMode( KFileDialog::Opening );
|
||||
dlg.setMode(KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly);
|
||||
|
||||
kapp->setTopWidget( &myDialog );
|
||||
kapp->setTopWidget( &dlg );
|
||||
|
||||
Widgets::handleXGeometry(&myDialog);
|
||||
if ( !title.isEmpty() )
|
||||
myDialog.setCaption( title );
|
||||
Widgets::handleXGeometry(&dlg);
|
||||
if ( !title.isEmpty() )
|
||||
dlg.setCaption( title );
|
||||
|
||||
if ( myDialog.exec() == QDialog::Accepted )
|
||||
url = myDialog.url();
|
||||
dlg.exec();
|
||||
|
||||
if ( url.isValid() )
|
||||
result = url.path();
|
||||
result = dlg.selectedUrl().toLocalFile();
|
||||
if (!result.isEmpty()) {
|
||||
cout << result.toLocal8Bit().data() << endl;
|
||||
return 0;
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include <QTimer>
|
||||
|
||||
#include <KDebug>
|
||||
#include <KDirSelectDialog>
|
||||
#include <KDirWatch>
|
||||
#include <KFileDialog>
|
||||
#include <KRandom>
|
||||
|
@ -344,16 +343,19 @@ void Image::timeChanged(const QTime& time)
|
|||
void Image::addDir()
|
||||
{
|
||||
KUrl empty;
|
||||
KDirSelectDialog *dialog = new KDirSelectDialog(empty, true, m_configWidget);
|
||||
QString empty2;
|
||||
KFileDialog *dialog = new KFileDialog(empty, empty2, m_configWidget);
|
||||
dialog->setOperationMode(KFileDialog::Opening);
|
||||
dialog->setMode(KFile::Directory | KFile::LocalOnly | KFile::ExistingOnly);
|
||||
connect(dialog, SIGNAL(accepted()), this, SLOT(addDirFromSelectionDialog()));
|
||||
dialog->show();
|
||||
}
|
||||
|
||||
void Image::addDirFromSelectionDialog()
|
||||
{
|
||||
KDirSelectDialog *dialog = qobject_cast<KDirSelectDialog *>(sender());
|
||||
KFileDialog *dialog = qobject_cast<KFileDialog *>(sender());
|
||||
if (dialog) {
|
||||
QString urlDir = dialog->url().path();
|
||||
QString urlDir = dialog->selectedUrl().toLocalFile();
|
||||
if (!urlDir.isEmpty() && m_uiSlideshow.m_dirlist->findItems(urlDir, Qt::MatchExactly).isEmpty()) {
|
||||
m_uiSlideshow.m_dirlist->addItem(urlDir);
|
||||
updateDirs();
|
||||
|
|
Loading…
Add table
Reference in a new issue