File indexing completed on 2024-04-14 14:20:36
0001 #include <QApplication> 0002 #include <kdirselectdialog.h> 0003 #include <kmessagebox.h> 0004 #include <QUrl> 0005 0006 int main(int argc, char **argv) 0007 { 0008 //KCmdLineOptions opt; 0009 //opt.add("+[startDir]", qi18n("Directory to start in"), QByteArray()); 0010 0011 QApplication app(argc, argv); 0012 app.setQuitOnLastWindowClosed(false); 0013 0014 QUrl startDir; 0015 if (argc > 1) { 0016 startDir = QUrl::fromLocalFile(argv[1]); 0017 } 0018 QUrl u = KDirSelectDialog::selectDirectory(startDir); 0019 if (u.isValid()) 0020 KMessageBox::information(nullptr, 0021 QString("You selected the url: %1") 0022 .arg(u.toString()), "Selected URL"); 0023 0024 return 0; 0025 }