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})
|
add_executable(kdialog ${kdialog_SRCS})
|
||||||
|
|
||||||
# Need libkfile due to the code that adjusts the geometry of the KDirSelectDialog
|
|
||||||
target_link_libraries(kdialog
|
target_link_libraries(kdialog
|
||||||
KDE4::kfile
|
KDE4::kfile
|
||||||
KDE4::kio
|
KDE4::kio
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
#include <kfiledialog.h>
|
#include <kfiledialog.h>
|
||||||
#include <kfileitem.h>
|
#include <kfileitem.h>
|
||||||
#include <kicondialog.h>
|
#include <kicondialog.h>
|
||||||
#include <kdirselectdialog.h>
|
|
||||||
#include <kcolordialog.h>
|
#include <kcolordialog.h>
|
||||||
#include <kwindowsystem.h>
|
#include <kwindowsystem.h>
|
||||||
#include <kiconloader.h>
|
#include <kiconloader.h>
|
||||||
|
@ -620,21 +619,20 @@ static int directCommand(KCmdLineArgs *args)
|
||||||
if (args->isSet("getexistingdirectory")) {
|
if (args->isSet("getexistingdirectory")) {
|
||||||
QString startDir;
|
QString startDir;
|
||||||
startDir = args->getOption("getexistingdirectory");
|
startDir = args->getOption("getexistingdirectory");
|
||||||
QString result;
|
QString result;
|
||||||
KUrl url;
|
KFileDialog dlg( startDir, QString(), 0 );
|
||||||
KDirSelectDialog myDialog( startDir, true, 0 );
|
dlg.setOperationMode( KFileDialog::Opening );
|
||||||
|
dlg.setMode(KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly);
|
||||||
|
|
||||||
kapp->setTopWidget( &myDialog );
|
kapp->setTopWidget( &dlg );
|
||||||
|
|
||||||
Widgets::handleXGeometry(&myDialog);
|
Widgets::handleXGeometry(&dlg);
|
||||||
if ( !title.isEmpty() )
|
if ( !title.isEmpty() )
|
||||||
myDialog.setCaption( title );
|
dlg.setCaption( title );
|
||||||
|
|
||||||
if ( myDialog.exec() == QDialog::Accepted )
|
dlg.exec();
|
||||||
url = myDialog.url();
|
|
||||||
|
|
||||||
if ( url.isValid() )
|
result = dlg.selectedUrl().toLocalFile();
|
||||||
result = url.path();
|
|
||||||
if (!result.isEmpty()) {
|
if (!result.isEmpty()) {
|
||||||
cout << result.toLocal8Bit().data() << endl;
|
cout << result.toLocal8Bit().data() << endl;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
#include <KDebug>
|
#include <KDebug>
|
||||||
#include <KDirSelectDialog>
|
|
||||||
#include <KDirWatch>
|
#include <KDirWatch>
|
||||||
#include <KFileDialog>
|
#include <KFileDialog>
|
||||||
#include <KRandom>
|
#include <KRandom>
|
||||||
|
@ -344,16 +343,19 @@ void Image::timeChanged(const QTime& time)
|
||||||
void Image::addDir()
|
void Image::addDir()
|
||||||
{
|
{
|
||||||
KUrl empty;
|
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()));
|
connect(dialog, SIGNAL(accepted()), this, SLOT(addDirFromSelectionDialog()));
|
||||||
dialog->show();
|
dialog->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Image::addDirFromSelectionDialog()
|
void Image::addDirFromSelectionDialog()
|
||||||
{
|
{
|
||||||
KDirSelectDialog *dialog = qobject_cast<KDirSelectDialog *>(sender());
|
KFileDialog *dialog = qobject_cast<KFileDialog *>(sender());
|
||||||
if (dialog) {
|
if (dialog) {
|
||||||
QString urlDir = dialog->url().path();
|
QString urlDir = dialog->selectedUrl().toLocalFile();
|
||||||
if (!urlDir.isEmpty() && m_uiSlideshow.m_dirlist->findItems(urlDir, Qt::MatchExactly).isEmpty()) {
|
if (!urlDir.isEmpty() && m_uiSlideshow.m_dirlist->findItems(urlDir, Qt::MatchExactly).isEmpty()) {
|
||||||
m_uiSlideshow.m_dirlist->addItem(urlDir);
|
m_uiSlideshow.m_dirlist->addItem(urlDir);
|
||||||
updateDirs();
|
updateDirs();
|
||||||
|
|
Loading…
Add table
Reference in a new issue