diff --git a/src/mainWindow.cpp b/src/mainWindow.cpp --- a/src/mainWindow.cpp +++ b/src/mainWindow.cpp @@ -132,6 +132,27 @@ slotScanUrl(u); } +static QString toNative(const QString &pathName) +{ +//#if defined(Q_OS_WIN) + int i = pathName.indexOf(QLatin1Char('/')); + if (i != -1) { + QString n(pathName); + + QChar * const data = n.data(); + data[i++] = QLatin1Char('\\'); + + for (; i < n.length(); ++i) { + if (data[i] == QLatin1Char('/')) + data[i] = QLatin1Char('\\'); + } + + return n; + } +//#endif + return pathName; +} + void MainWindow::setupActions() //singleton function { KActionCollection *const ac = actionCollection(); @@ -253,8 +274,12 @@ path = KShell::tildeExpand(path); - if (slotScanPath(path)) + qDebug() << "++++ slot scan path"; + if (slotScanPath(path)) { + qDebug() << "++++ scanned!"; + qDebug() << url.isLocalFile() << toNative(path); m_combo->addToHistory(path); + } } bool MainWindow::slotScanPath(const QString &path) @@ -416,7 +441,7 @@ } QString MainWindow::prettyUrl() const { - return url().isLocalFile() ? url().toLocalFile() : url().toString(); + return url().isLocalFile() ? toNative(url().toLocalFile()) : url().toString(); } void MainWindow::updateURL(const QUrl &u)