[SCM] ktp-contact-applet packaging branch, master, updated. debian/15.12.1-1-966-gde83ac5

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:16:23 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=3103f62

The following commit has been merged in the master branch:
commit 3103f62214852b4360527d055110c02e3d46430c
Author: Dan Vrátil <dvratil at redhat.com>
Date:   Tue Jan 8 01:35:54 2013 +0100

    Add Plasma script to update plasma-desktop configuration
    
    The script is run on Plasma start and migrates all old applet
    names to new names.
---
 50-renameKTpApplets.js | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++
 CMakeLists.txt         |  2 ++
 2 files changed, 87 insertions(+)

diff --git a/50-renameKTpApplets.js b/50-renameKTpApplets.js
new file mode 100644
index 0000000..7ce7061
--- /dev/null
+++ b/50-renameKTpApplets.js
@@ -0,0 +1,85 @@
+/*
+ * KTp Applets Migration Script
+ *
+ * Copyright (C) 2013 Dan Vrátil <dvratil at redhat.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ *
+ *
+ * After migrating all Plasma applets to ktp-desktop-applets repository,
+ * we renamed the to conform our naming policy. All applets are now called
+ * org.kde.ktp-%appletname%.
+ * This scripts replaces the old applets by new ones in order to make this
+ * transition seemless for users.
+ */
+                  
+
+var template = loadTemplate('org.kde.plasma-desktop.findWidgets')
+
+function createWidget(widget, containment, newWidgetType)
+{
+  var wasLocked = containment.locked;
+  containment.locked = false;
+  
+  var newWidget = containment.addWidget(newWidgetType);
+  newWidget.geometry = widget.geometry;
+  newWidget.index = widget.index;
+  newWidget.globalShortcut = widget.shortcut;
+
+  for (i = 0; i < widget.configKeys.length; i++) {
+    var key = widget.configKeys[i];
+    newWidget.writeConfig(key, widget.readConfig(key));
+  }
+
+  newWidget.locked = widget.locked;
+
+  widget.locked = false;
+  widget.remove();
+
+  containment.locked = wasLocked;
+}
+
+/* Unlock widgets */
+var wasLocked = locked;
+locked = false;
+
+template.findWidgets("org.kde.ktp-chatplasmoid", replaceChatPlasmoid);
+template.findWidgets("org.kde.ktp.contactlist", replaceContactlist);
+template.findWidgets("ktp_presence", replacePresence);
+template.findWidgets("ktp_contact", replaceContact);
+
+
+function replaceChatPlasmoid(widget, containment)
+{
+  createWidget(widget, containment, "org.kde.ktp-chat");
+}
+
+function replaceContactlist(widget, containment)
+{
+  createWidget(widget, containment, "org.kde.ktp-contactlist");
+}
+
+function replacePresence(widget, containment)
+{
+  createWidget(widget, containment, "org.kde.ktp-presence");
+}
+
+function replaceContact(widget, containment)
+{
+  createWidget(widget, containment, "org.kde.ktp-contact");
+}
+
+locked = wasLocked;
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3e6d8df..fc7abeb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,3 +28,5 @@ add_subdirectory(chat)
 add_subdirectory(contact)
 add_subdirectory(contactlist)
 add_subdirectory(presence)
+
+install(FILES 50-renameKTpApplets.js DESTINATION ${DATA_INSTALL_DIR}/plasma-desktop/updates)

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list