[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kronometer] /: Work
From:       Elvis Angelaccio <null () kde ! org>
Date:       2017-05-31 17:34:18
Message-ID: E1dG7Vi-0000c3-7g () code ! kde ! org
[Download RAW message or body]

Git commit 0d9773d2d0df60ed8a701f85a3c5173f55d67041 by Elvis Angelaccio.
Committed on 22/05/2017 at 20:22.
Pushed by elvisangelaccio into branch 'master'.

Work

M  +1    -1    CMakeLists.txt
M  +4    -4    src/gui/mainwindow.cpp
M  +2    -2    src/gui/mainwindow.h

https://commits.kde.org/kronometer/0d9773d2d0df60ed8a701f85a3c5173f55d67041

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0fa7ab2..e21366e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
 project(kronometer)
 
 cmake_minimum_required(VERSION 3.1)
-set(QT_MIN_VERSION 5.7.0)
+set(QT_MIN_VERSION 5.9.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 1e0e76c..d2cc3d3 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->selectedNameFilter());
+            exportLapsAs(dialog->selectedFiles().at(0), dialog->selectedMimeTypeFilter());
         }
         dialog->deleteLater();
     });
@@ -586,7 +586,7 @@ void MainWindow::loadSession()
     setWindowTitle(m_session.name());
 }
 
-void MainWindow::exportLapsAs(const QString& name, const QString& nameFilter)
+void MainWindow::exportLapsAs(const QString& name, const QString& mimeType)
 {
     if (name.isEmpty()) {
         return;
@@ -594,7 +594,7 @@ void MainWindow::exportLapsAs(const QString& name, const QString& nameFilter)
 
     auto exportName = name;
 
-    if (nameFilter.contains(QLatin1String(".json"))) {
+    if (mimeType == QLatin1String("application/json")) {
         if (not exportName.endsWith(QLatin1String(".json"))) {
             exportName += QLatin1String(".json");
         }
@@ -609,7 +609,7 @@ void MainWindow::exportLapsAs(const QString& name, const QString& nameFilter)
         exportFile.write(exportDoc.toJson());
         exportFile.commit();
     }
-    else if (nameFilter.contains(QLatin1String(".csv"))) {
+    else if (mimeType == QLatin1String("text/csv")) {
         if (not exportName.endsWith(QLatin1String(".csv"))) {
             exportName += QLatin1String(".csv");
         }
diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h
index 35c210d..ba28982 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 nameFilter The name filter of the file to be created.
+     * @param mimeType The mime type of the file to be created.
      */
-    void exportLapsAs(const QString& name, const QString& nameFilter);
+    void exportLapsAs(const QString& name, const QString& mimeType);
 
     /**
      * 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