[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/plasma
From: Matt Broadstone <mbroadst () gmail ! com>
Date: 2007-02-27 22:21:22
Message-ID: 1172614882.505991.9045.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 637815 by mbroadst:
get things building - somewhat
M +1 -1 lib/dataengine.h
A plasma/CMakeLists.txt
M +26 -19 plasma/enginemanager.cpp
M +5 -6 plasma/enginemanager.h
M +16 -9 plasma/main.cpp
M +18 -14 plasma/plasmaapp.cpp
M +9 -4 plasma/plasmaapp.h
--- trunk/KDE/kdebase/workspace/plasma/lib/dataengine.h #637814:637815
@@ -79,7 +79,7 @@
void clearAllDataSources();
private:
- QAtomic ref;
+ QAtomic m_ref;
class Private;
Private* d;
};
--- trunk/KDE/kdebase/workspace/plasma/plasma/enginemanager.cpp #637814:637815
@@ -16,26 +16,29 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include "enginemanager.h"
+
#include <kservicetypetrader.h>
+#include <kparts/componentfactory.h>
+#include "enginemanager.h"
+
DataEngineManager::DataEngineManager()
{
}
-~DataEngineManager::DataEngineManager()
+DataEngineManager::~DataEngineManager()
{
- foreach (Plasma::DataEngine* engine, engines)
+ foreach (Plasma::DataEngine* engine, m_engines)
{
delete engine;
}
- engines.clear();
+ m_engines.clear();
}
Plasma::DataEngine* DataEngineManager::engine(const QString& name) const
{
- Plasma::DataEngine::Dict::iterator it = engines.find(name);
- if (it != engines.end())
+ Plasma::DataEngine::Dict::const_iterator it = m_engines.find(name);
+ if (it != m_engines.end())
{
// ref and return the engine
//Plasma::DataEngine *engine = *it;
@@ -45,13 +48,14 @@
return 0;
}
-bool DataEngineManager::loadEngine(const QString& name)
+bool DataEngineManager::loadDataEngine(const QString& name)
{
- Plasma::DataEngine* engine = engine(name);
+/*
+ Plasma::DataEngine* dataEngine = engine(name);
- if (engine)
+ if (dataEngine)
{
- engine->ref();
+ dataEngine->ref();
return true;
}
@@ -64,7 +68,7 @@
}
int errorCode = 0;
- engine = KParts::ComponentFactory::createInstanceFromService<Plasma::DataEngine>
+ dataEngine = KParts::ComponentFactory::createInstanceFromService<Plasma::DataEngine>
(offers.first(), 0, 0, QStringList(), &errorCode);
if (!engine)
@@ -72,22 +76,25 @@
return false;
}
- engines[name] = engine;
+ m_engines[name] = dataEngine;
return true;
+*/
+
+ return false;
}
-void DataEngineManager::unloadEngine(const QString& name)
+void DataEngineManager::unloadDataEngine(const QString& name)
{
- Plasma::DataEngine* engine = engine(name);
+ Plasma::DataEngine* dataEngine = engine(name);
- if (engine)
+ if (dataEngine)
{
- engine->deref();
+ dataEngine->deref();
- if (!engine->used())
+ if (!dataEngine->isUsed())
{
- engines.remove(name);
- delete engine;
+ m_engines.remove(name);
+ delete dataEngine;
}
}
}
--- trunk/KDE/kdebase/workspace/plasma/plasma/enginemanager.h #637814:637815
@@ -20,19 +20,18 @@
#define PLASMA_ENGINE_MANAGER_H
#include <QHash>
+#include "dataengine.h"
-namespace Plasma
-{
- class DataEngine;
-}
-
class DataEngineManager
{
public:
+ typedef QHash<QString, Plasma::DataEngine*> Dict;
+
+ public:
DataEngineManager();
~DataEngineManager();
- Plasma::DataEngine* engine(const QString& name);
+ Plasma::DataEngine* engine(const QString& name) const;
bool loadDataEngine(const QString& name);
void unloadDataEngine(const QString& name);
--- trunk/KDE/kdebase/workspace/plasma/plasma/main.cpp #637814:637815
@@ -16,20 +16,27 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <kapplication.h>
+#include <KApplication>
+#include <KAboutData>
+#include <KCmdLineArgs>
+#include <KLocale>
#include "config.h"
-
#include "plasmaapp.h"
-int main(int argc, const char* argv[])
+static const char description[] = I18N_NOOP( "The KDE desktop, panels and widgets \
workspace application." ); +static const char version[] = "0.0";
+
+int main(int argc, char **argv)
{
- KAboutData aboutData( "plasma", I18N_NOOP("Plasma Workspace"),
- "0.0",
- I18N_NOOP("The KDE desktop, panels and widgets workspace \
application."),
- KAboutData::License_GPL,
- I18N_NOOP("(c) 2006, The KDE Team") );
- aboutData.addAuthor("Aaron J. Seigo", I18N_NOOP("Current maintainer"), \
"aseigo@kde.org"); + KAboutData aboutData( "plasma-qgv", I18N_NOOP( "Plasma \
Workspace" ), + version, description, \
KAboutData::License_GPL, + "(c) 2006, The KDE Team" );
+ aboutData.addAuthor( "Aaron J. Seigo",
+ I18N_NOOP( "Author and maintainer" ),
+ "aseigo@kde.org" );
+
+
KCmdLineArgs::init(argc, argv, &aboutData);
PlasmaApp app;
--- trunk/KDE/kdebase/workspace/plasma/plasma/plasmaapp.cpp #637814:637815
@@ -20,10 +20,15 @@
// LineGraph graph
// plasma.connect(graph, "hardware", "cpu");
-#include "plasmaapp.h"
+#include <unistd.h>
+#include <QTimer>
+
#include <kcrash.h>
+#include "plasmaapp.h"
+#include "plasmaapp.moc"
+
PlasmaApp* PlasmaApp::self()
{
return qobject_cast<PlasmaApp*>(kapp);
@@ -31,7 +36,7 @@
PlasmaApp::PlasmaApp()
: KUniqueApplication(),
- engines(0)
+ m_engineManager(0)
{
notifyStartup(false);
if (KCrash::crashHandler() == 0 )
@@ -49,17 +54,19 @@
setCrashHandler();
}
+/*
dcopClient()->send("ksplash", "", "upAndRunning(QString)",
QString::fromLocal8Bit(KCmdLineArgs::appName()));
+*/
m_interface = this;
- engines = new DataEngineManager();
+ m_engineManager = new DataEngineManager;
notifyStartup(true);
}
void PlasmaApp::setCrashHandler()
{
- KCrash::setEmergencySaveFunction(Kicker::crashHandler);
+// KCrash::setEmergencySaveFunction(Kicker::crashHandler);
}
void PlasmaApp::crashHandler(int signal)
@@ -68,34 +75,30 @@
fprintf(stderr, "Plasma crashed, attempting to automatically recover\n");
- DCOPClient::emergencyClose();
+// DCOPClient::emergencyClose();
sleep(1);
system("plasma --nocrashhandler &"); // try to restart
}
bool PlasmaApp::loadDataEngine(const QString& name)
{
- if (!engines)
- {
+ if (!m_engineManager)
return false;
- }
- Plasma::DataEngine* engine = engines->loadDataEngine(name);
- return (engine != 0);
+ return m_engineManager->loadDataEngine(name);
}
void PlasmaApp::unloadDataEngine(const QString& name)
{
- if (!engines)
- {
+ if (!m_engineManager)
return;
- }
- engines->unloadDataEngine(name);
+ m_engineManager->unloadDataEngine(name);
}
void PlasmaApp::notifyStartup(bool completed)
{
+/*
const QString startupID("workspace desktop");
DCOPClient cl;
cl.attach();
@@ -110,4 +113,5 @@
{
r.send("suspendStartup", startupID);
}
+*/
}
--- trunk/KDE/kdebase/workspace/plasma/plasma/plasmaapp.h #637814:637815
@@ -19,10 +19,14 @@
#ifndef PLASMA_APP_H
#define PLASMA_APP_H
-#include "lib/interface.h"
-#include <kuniquapplication.h>
+#include <KUniqueApplication>
+#include "interface.h"
+#include "enginemanager.h"
+
+class QGraphicsView;
+class QGraphicsScene;
class PlasmaApp : public KUniqueApplication, public Plasma::Interface
{
public:
@@ -33,7 +37,7 @@
// Plasma::Interface
bool loadDataEngine(const QString& name);
- bool unloadDataEngine(const QString& name);
+ void unloadDataEngine(const QString& name);
void notifyStartup(bool completed);
@@ -43,7 +47,8 @@
private:
void crashHandler(int signal);
- EngineManager engines;
+ DataEngineManager *m_engineManager;
+
};
#endif // multiple inclusion guard
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic