remove Context class
This commit is contained in:
parent
e73f4bf9f2
commit
953cce2c7c
@ -87,7 +87,6 @@ set(plasma_LIB_SRCS
|
||||
containment.cpp
|
||||
containmentactions.cpp
|
||||
containmentactionspluginsconfig.cpp
|
||||
context.cpp
|
||||
corona.cpp
|
||||
datacontainer.cpp
|
||||
dataengine.cpp
|
||||
@ -290,7 +289,6 @@ set(plasma_LIB_INCLUDES
|
||||
containment.h
|
||||
containmentactions.h
|
||||
containmentactionspluginsconfig.h
|
||||
context.h
|
||||
corona.h
|
||||
datacontainer.h
|
||||
dataengine.h
|
||||
|
89
context.cpp
89
context.cpp
@ -1,89 +0,0 @@
|
||||
/*
|
||||
* Copyright 2008 by Aaron Seigo <aseigo@kde.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "context.h"
|
||||
|
||||
namespace Plasma
|
||||
{
|
||||
|
||||
class ContextPrivate
|
||||
{
|
||||
public:
|
||||
QString activityId;
|
||||
QString activityName;
|
||||
};
|
||||
|
||||
Context::Context(QObject *parent)
|
||||
: QObject(parent),
|
||||
d(new ContextPrivate)
|
||||
{
|
||||
//TODO: look up activity in Nepomuk
|
||||
//except we can't, because that code is in kdebase.
|
||||
}
|
||||
|
||||
Context::~Context()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
|
||||
void Context::createActivity(const QString &name)
|
||||
{
|
||||
Q_UNUSED(name);
|
||||
}
|
||||
|
||||
QStringList Context::listActivities() const
|
||||
{
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
void Context::setCurrentActivity(const QString &name)
|
||||
{
|
||||
if (d->activityName == name || name.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
d->activityName = name;
|
||||
emit activityChanged(this);
|
||||
emit changed(this);
|
||||
}
|
||||
|
||||
QString Context::currentActivity() const
|
||||
{
|
||||
return d->activityName;
|
||||
}
|
||||
|
||||
void Context::setCurrentActivityId(const QString &id)
|
||||
{
|
||||
if (d->activityId == id) {
|
||||
return;
|
||||
}
|
||||
|
||||
d->activityId = id;
|
||||
emit changed(this);
|
||||
}
|
||||
|
||||
QString Context::currentActivityId() const
|
||||
{
|
||||
return d->activityId;
|
||||
}
|
||||
|
||||
} // namespace Plasma
|
||||
|
||||
#include "context.moc"
|
||||
|
67
context.h
67
context.h
@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Copyright 2008 by Aaron Seigo <aseigo@kde.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef PLASMA_CONTEXT_H
|
||||
#define PLASMA_CONTEXT_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
#include "plasma_export.h"
|
||||
|
||||
namespace Plasma
|
||||
{
|
||||
|
||||
class ContextPrivate;
|
||||
|
||||
class PLASMA_EXPORT Context : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit Context(QObject *parent = 0);
|
||||
~Context();
|
||||
|
||||
//don't use these two
|
||||
void createActivity(const QString &name);
|
||||
QStringList listActivities() const;
|
||||
|
||||
//activity name
|
||||
void setCurrentActivity(const QString &name);
|
||||
QString currentActivity() const;
|
||||
|
||||
//activity id
|
||||
void setCurrentActivityId(const QString &id);
|
||||
QString currentActivityId() const;
|
||||
|
||||
//TODO: location
|
||||
|
||||
Q_SIGNALS:
|
||||
void changed(Plasma::Context *context);
|
||||
void activityChanged(Plasma::Context *context);
|
||||
void locationChanged(Plasma::Context *context);
|
||||
|
||||
private:
|
||||
ContextPrivate * const d;
|
||||
};
|
||||
|
||||
} // namespace Plasma
|
||||
|
||||
#endif // multiple inclusion guard
|
||||
|
Loading…
x
Reference in New Issue
Block a user