[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kronometer] /: Revert "Work"
From: Elvis Angelaccio <null () kde ! org>
Date: 2017-05-31 17:37:26
Message-ID: E1dG7Yk-0003M4-NY () code ! kde ! org
[Download RAW message or body]
Git commit 1aefdb6471064b70ab4639fe9df06bd46a0cfe85 by Elvis Angelaccio.
Committed on 31/05/2017 at 17:38.
Pushed by elvisangelaccio into branch 'master'.
Revert "Work"
This was not supposed to be pushed (yet).
This reverts commit 0d9773d2d0df60ed8a701f85a3c5173f55d67041.
M +1 -1 CMakeLists.txt
M +4 -4 src/gui/mainwindow.cpp
M +2 -2 src/gui/mainwindow.h
https://commits.kde.org/kronometer/1aefdb6471064b70ab4639fe9df06bd46a0cfe85
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e21366e..0fa7ab2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
project(kronometer)
cmake_minimum_required(VERSION 3.1)
-set(QT_MIN_VERSION 5.9.0)
+set(QT_MIN_VERSION 5.7.0)
set(KF5_MIN_VERSION 5.26.0)
set(PROJECT_VERSION 2.1.70)
diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp
index d2cc3d3..1e0e76c 100644
--- a/src/gui/mainwindow.cpp
+++ b/src/gui/mainwindow.cpp
@@ -305,7 +305,7 @@ void MainWindow::slotExportLapsAs()
connect(dialog, &QDialog::finished, this, [this, dialog](int result) {
if (result == QDialog::Accepted) {
- exportLapsAs(dialog->selectedFiles().at(0), dialog->selectedMimeTypeFilter());
+ exportLapsAs(dialog->selectedFiles().at(0), dialog->selectedNameFilter());
}
dialog->deleteLater();
});
@@ -586,7 +586,7 @@ void MainWindow::loadSession()
setWindowTitle(m_session.name());
}
-void MainWindow::exportLapsAs(const QString& name, const QString& mimeType)
+void MainWindow::exportLapsAs(const QString& name, const QString& nameFilter)
{
if (name.isEmpty()) {
return;
@@ -594,7 +594,7 @@ void MainWindow::exportLapsAs(const QString& name, const QString& mimeType)
auto exportName = name;
- if (mimeType == QLatin1String("application/json")) {
+ if (nameFilter.contains(QLatin1String(".json"))) {
if (not exportName.endsWith(QLatin1String(".json"))) {
exportName += QLatin1String(".json");
}
@@ -609,7 +609,7 @@ void MainWindow::exportLapsAs(const QString& name, const QString& mimeType)
exportFile.write(exportDoc.toJson());
exportFile.commit();
}
- else if (mimeType == QLatin1String("text/csv")) {
+ else if (nameFilter.contains(QLatin1String(".csv"))) {
if (not exportName.endsWith(QLatin1String(".csv"))) {
exportName += QLatin1String(".csv");
}
diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h
index ba28982..35c210d 100644
--- a/src/gui/mainwindow.h
+++ b/src/gui/mainwindow.h
@@ -197,9 +197,9 @@ private:
/**
* Export current lap times on a new file.
* @param name The name of the file to be created.
- * @param mimeType The mime type of the file to be created.
+ * @param nameFilter The name filter of the file to be created.
*/
- void exportLapsAs(const QString& name, const QString& mimeType);
+ void exportLapsAs(const QString& name, const QString& nameFilter);
/**
* Write the JSON laps representation on the given object.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic