Commit 8c165059 authored by Michael Pyne's avatar Michael Pyne

tagtransactionmanager: Remove my custom global static.

parent 3e848aa5
......@@ -163,8 +163,6 @@ void JuK::coverDownloaded(const QPixmap &cover)
void JuK::setupLayout()
{
new TagTransactionManager(this);
m_splitter = new PlaylistSplitter(m_player, this);
setCentralWidget(m_splitter);
......
......@@ -16,13 +16,14 @@
#include "tagtransactionmanager.h"
#include <kmessagebox.h>
#include <KMessageBox>
#include <KLocalizedString>
#include <QAction>
#include <QApplication>
#include <QFileInfo>
#include <QDir>
#include <QGlobalStatic>
#include "playlistitem.h"
#include "collectionlist.h"
......@@ -32,7 +33,7 @@
using ActionCollection::action;
TagTransactionManager *TagTransactionManager::m_manager = 0;
Q_GLOBAL_STATIC(TagTransactionManager, g_tagManager)
TagTransactionAtom::TagTransactionAtom() : m_item(0), m_tag(0)
{
......@@ -67,7 +68,7 @@ TagTransactionAtom &TagTransactionAtom::operator=(const TagTransactionAtom &othe
TagTransactionManager *TagTransactionManager::instance()
{
return m_manager;
return g_tagManager;
}
void TagTransactionManager::changeTagOnItem(PlaylistItem *item, Tag *newTag)
......@@ -125,12 +126,6 @@ bool TagTransactionManager::undo()
return result;
}
TagTransactionManager::TagTransactionManager(QWidget *parent) : QObject(parent)
{
setObjectName( QLatin1String("tagmanager" ));
m_manager = this;
}
bool TagTransactionManager::renameFile(const QFileInfo &from, const QFileInfo &to) const
{
if(!QFileInfo(to.path()).isWritable() || !from.exists())
......
......@@ -111,13 +111,6 @@ class TagTransactionManager : public QObject
Q_OBJECT
public:
/**
* Constructs a TagTransactionManager, owned by @p parent.
*
* @param parent The parent QWidget.
*/
TagTransactionManager(QWidget *parent = 0);
/**
* Returns the global TagTransactionManager instance.
*
......@@ -136,7 +129,7 @@ class TagTransactionManager : public QObject
void changeTagOnItem(PlaylistItem *item, Tag *newTag);
/**
* Convienience function to duplicate a Tag object, since the Tag
* Convenience function to duplicate a Tag object, since the Tag
* object doesn't have a decent copy constructor.
*
* @param tag The Tag to duplicate.
......@@ -208,7 +201,6 @@ class TagTransactionManager : public QObject
TagAlterationList m_list; ///< holds a list of changes to commit
TagAlterationList m_undoList; ///< holds a list of changes to undo
static TagTransactionManager *m_manager; ///< used by instance()
};
#endif /* TAGTRANSACTIONMANAGER_H */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment