}
clock_t start = clock();
m_table->setSortingEnabled(false);
- fillTable(ReQStringUtils::chomp(m_baseDir, OS_SEPARATOR), 0);
+ QString path = ReFileUtils::nativePath(m_baseDir);
+ path = ReQStringUtils::chomp(path, OS_SEPARATOR);
+ fillTable(path, 0);
m_statistics.m_runtimeSeconds = (double) (clock() - start)
/ CLOCKS_PER_SEC;
if (m_announcer != NULL){
QString dir = QFileDialog::getExistingDirectory(this, tr("Select Directory"),
ui->comboBoxDirectory->currentText(), QFileDialog::ShowDirsOnly);
if (!dir.isEmpty())
- ui->comboBoxDirectory->setCurrentText(dir);
+ ui->comboBoxDirectory->setCurrentText(ReFileUtils::nativePath(dir));
}
/**
if (dir.exists()){
dir.cdUp();
if (dir.exists()){
- path = dir.absolutePath();
+ path = ReFileUtils::nativePath(dir.absolutePath());
ui->comboBoxDirectory->setEditText(path);
setInHistory(ui->comboBoxDirectory, path);
}
static QByteArray extensionOf(const char* filename);
static bool isAbsolutPath(const QString& path);
static bool isAbsolutPath(const char* path);
+ /** Returns a path with native separators.
+ * QT under windows can operator with 2 separators: '\\' and '/'.
+ * '\\' is the native separator.
+ * @param path the path to inspect
+ * @return the path with native separators.
+ */
+ inline static QString nativePath(QString path){
+#if defined __linux__
+ return path;
+#elif defined WIN32
+ return path.replace(OS_2nd_SEPARATOR, OS_SEPARATOR);
+#endif
+ }
+ /** Returns a path with native separators.
+ * QT under windows can operator with 2 separators: '\\' and '/'.
+ * '\\' is the native separator.
+ * @param path the path to inspect
+ * @return the path with native separators.
+ */
+ inline static QByteArray nativePath(QByteArray path){
+#if defined __linux__
+ return path;
+#elif defined WIN32
+ return path.replace(OS_2nd_SEPARATOR, OS_SEPARATOR);
+#endif
+ }
static QString nodeOf(const QString& filename);
static QByteArray nodeOf(const char* filename);
static QString parentOf(const QString& filename);