From cfe1ebf0f2d2a0854582893d68ebbf528786a068 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sun, 23 Oct 2011 17:19:18 +0000 Subject: fixed api git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2426 90c681e8-e032-0410-971d-27865f9a5e38 --- src/qmmpui/general.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/qmmpui/general.cpp') diff --git a/src/qmmpui/general.cpp b/src/qmmpui/general.cpp index 2ae7b7199..9fc1a8703 100644 --- a/src/qmmpui/general.cpp +++ b/src/qmmpui/general.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2010 by Ilya Kotov * + * Copyright (C) 2008-2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -26,16 +26,16 @@ #include "general.h" QList *General::m_factories = 0; -QStringList General::m_files; -QMap *General::m_generals = 0; +QHash *General::m_files = 0; +QHash *General::m_generals = 0; QObject *General::m_parent = 0; void General::checkFactories() { if (!m_factories) { - m_files.clear(); m_factories = new QList; + m_files = new QHash ; QDir pluginsDir (Qmmp::pluginsPath()); pluginsDir.cd("General"); foreach (QString fileName, pluginsDir.entryList(QDir::Files)) @@ -54,7 +54,7 @@ void General::checkFactories() if (factory) { m_factories->append(factory); - m_files << pluginsDir.absoluteFilePath(fileName); + m_files->insert(factory, pluginsDir.absoluteFilePath(fileName)); qApp->installTranslator(factory->createTranslator(qApp)); } } @@ -65,7 +65,7 @@ void General::create(QObject *parent) { if(m_generals) return; - m_generals = new QMap (); + m_generals = new QHash (); m_parent = parent; checkFactories(); foreach(GeneralFactory* factory, *General::factories()) @@ -84,10 +84,10 @@ QList *General::factories() return m_factories; } -QStringList General::files() +QString General::file(GeneralFactory *factory) { checkFactories(); - return m_files; + return m_files->value(factory); } void General::setEnabled(GeneralFactory* factory, bool enable) -- cgit v1.2.3-13-gbd6f