summaryrefslogtreecommitdiffstats
path: root/kaffeine/src/player-parts/kaffeine-part/kaffeinepart.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-10 00:59:09 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-10 00:59:09 +0000
commit7f66b9e8ba186fb14a2db598a87dfa8de7b5a47b (patch)
treeb5e07812e82f00c780d2c035dca102b8e364f447 /kaffeine/src/player-parts/kaffeine-part/kaffeinepart.cpp
downloadkaffeine-7f66b9e8ba186fb14a2db598a87dfa8de7b5a47b.tar.gz
kaffeine-7f66b9e8ba186fb14a2db598a87dfa8de7b5a47b.zip
Added old abandoned KDE3 version of Kaffeine
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kaffeine@1088031 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kaffeine/src/player-parts/kaffeine-part/kaffeinepart.cpp')
-rw-r--r--kaffeine/src/player-parts/kaffeine-part/kaffeinepart.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/kaffeine/src/player-parts/kaffeine-part/kaffeinepart.cpp b/kaffeine/src/player-parts/kaffeine-part/kaffeinepart.cpp
new file mode 100644
index 0000000..4be8b73
--- /dev/null
+++ b/kaffeine/src/player-parts/kaffeine-part/kaffeinepart.cpp
@@ -0,0 +1,58 @@
+/*
+ * kaffeinepart.cpp
+ *
+ * Copyright (C) 2004-2005 Jürgen Kofler <kaffeine@gmx.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, 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 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 "kaffeinepart.h"
+#include <kapplication.h>
+#include <kservice.h>
+#include <ktrader.h>
+#include <kmessagebox.h>
+#include <krun.h>
+#include <klocale.h>
+
+#include "kaffeinepart.moc"
+
+KaffeinePart::KaffeinePart(QObject* parent, const char* name)
+ : KParts::ReadOnlyPart(parent, name)
+{
+}
+
+KaffeinePart::~KaffeinePart()
+{
+}
+
+bool KaffeinePart::installDistroCodec(QWidget* parent, const QString& engine, const QString& codec)
+{
+ QString query = QString("[X-KDE-Kaffeine-codec] == '%1' and \
+ [X-KDE-Kaffeine-engine] == '%2'").arg(codec).arg(engine);
+
+ KService::Ptr service = KTrader::self()->query( "Kaffeine/CodecInstall", query).first();
+
+ if (!service)
+ return false;
+
+ QString installScript = service->exec();
+
+ if (installScript.isNull())
+ return false;
+
+ KRun::runCommand(installScript);
+ return true;
+}
+