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

List:       kde-commits
Subject:    [juk/frameworks] /: Remove deprecated KLocale usage.
From:       Michael Pyne <null () kde ! org>
Date:       2017-09-30 21:33:47
Message-ID: E1dyPON-0007iK-J4 () code ! kde ! org
[Download RAW message or body]

Git commit 4b413f6f06265d7290cf6940cd6a1d4f30cb0391 by Michael Pyne.
Committed on 30/09/2017 at 17:25.
Pushed by mpyne into branch 'frameworks'.

Remove deprecated KLocale usage.

M  +6    -19   historyplaylist.cpp
M  +3    -5    historyplaylist.h

https://commits.kde.org/juk/4b413f6f06265d7290cf6940cd6a1d4f30cb0391

diff --git a/historyplaylist.cpp b/historyplaylist.cpp
index fddba4c..1ca4bd5 100644
--- a/historyplaylist.cpp
+++ b/historyplaylist.cpp
@@ -15,15 +15,14 @@
  */
 
 #include "historyplaylist.h"
-#include "collectionlist.h"
-#include "playermanager.h"
-#include "juk-exception.h"
 
 #include <QTimer>
 
-#include <klocale.h>
-#include <kglobal.h>
+#include <KLocale>
 
+#include "collectionlist.h"
+#include "playermanager.h"
+#include "juk-exception.h"
 #include "juk_debug.h"
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -89,25 +88,13 @@ HistoryPlaylistItem::HistoryPlaylistItem(CollectionListItem *item, Playlist *par
     PlaylistItem(item, parent, after),
     m_dateTime(QDateTime::currentDateTime())
 {
-    setText(0, KGlobal::locale()->formatDateTime(m_dateTime));
-}
-
-HistoryPlaylistItem::HistoryPlaylistItem(CollectionListItem *item, Playlist *parent) :
-    PlaylistItem(item, parent),
-    m_dateTime(QDateTime::currentDateTime())
-{
-    setText(0, KGlobal::locale()->formatDateTime(m_dateTime));
-}
-
-HistoryPlaylistItem::~HistoryPlaylistItem()
-{
-
+    setText(0, m_dateTime.toString());
 }
 
 void HistoryPlaylistItem::setDateTime(const QDateTime &dt)
 {
     m_dateTime = dt;
-    setText(0, KGlobal::locale()->formatDateTime(m_dateTime));
+    setText(0, m_dateTime.toString());
 }
 
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/historyplaylist.h b/historyplaylist.h
index 08450cf..876af1b 100644
--- a/historyplaylist.h
+++ b/historyplaylist.h
@@ -14,8 +14,8 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef HISTORYPLAYLIST_H
-#define HISTORYPLAYLIST_H
+#ifndef JUK_HISTORYPLAYLIST_H
+#define JUK_HISTORYPLAYLIST_H
 
 #include <QDateTime>
 
@@ -25,9 +25,7 @@
 class HistoryPlaylistItem : public PlaylistItem
 {
 public:
-    HistoryPlaylistItem(CollectionListItem *item, Playlist *parent, QTreeWidgetItem *after);
-    HistoryPlaylistItem(CollectionListItem *item, Playlist *parent);
-    virtual ~HistoryPlaylistItem();
+    HistoryPlaylistItem(CollectionListItem *item, Playlist *parent, QTreeWidgetItem *after = nullptr);
 
     QDateTime dateTime() const { return m_dateTime; }
     void setDateTime(const QDateTime &dt);

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

Configure | About | News | Add a list | Sponsored by KoreLogic