Hello community,

here is the log from the commit of package kparts for openSUSE:Factory checked 
in at 2017-08-24 17:57:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kparts (Old)
 and      /work/SRC/openSUSE:Factory/.kparts.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kparts"

Thu Aug 24 17:57:46 2017 rev:43 rq:516692 version:5.37.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/kparts/kparts.changes    2017-07-17 
10:25:10.830240381 +0200
+++ /work/SRC/openSUSE:Factory/.kparts.new/kparts.changes       2017-08-24 
17:57:47.734817811 +0200
@@ -1,0 +2,16 @@
+Sat Aug 12 09:23:34 UTC 2017 - [email protected]
+
+- Update to 5.37.0
+  * New feature release
+  * For more details please see:
+  * https://www.kde.org/announcements/kde-frameworks-5.37.0.php
+- Changes since 5.36.0 :
+  * Reset url in closeUrl()
+  * Fix typo in kpartsapp comment text
+  * API dox: update name of class providing createPartInstanceFromQuery()
+  * API dox: fix typo and wrong @see usage
+  * Add template for a simple kpart-based application
+  * Improve apidox of openFile()
+  * Drop usage of KDE_DEFAULT_WINDOWFLAGS
+
+-------------------------------------------------------------------

Old:
----
  kparts-5.36.0.tar.xz

New:
----
  kparts-5.37.0.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kparts.spec ++++++
--- /var/tmp/diff_new_pack.C2UwJh/_old  2017-08-24 17:57:49.254603750 +0200
+++ /var/tmp/diff_new_pack.C2UwJh/_new  2017-08-24 17:57:49.258603187 +0200
@@ -18,9 +18,9 @@
 
 %bcond_without lang
 %define lname   libKF5Parts5
-%define _tar_path 5.36
+%define _tar_path 5.37
 Name:           kparts
-Version:        5.36.0
+Version:        5.37.0
 Release:        0
 %define kf5_version %{version}
 BuildRequires:  cmake >= 3.0
@@ -131,5 +131,7 @@
 %dir %{_kf5_includedir}/*/
 %{_kf5_includedir}/*/
 %{_kf5_mkspecsdir}/qt_KParts.pri
+%dir %{_kf5_sharedir}/kdevappwizard
+%{_kf5_sharedir}/kdevappwizard/templates/
 
 %changelog

++++++ kparts-5.36.0.tar.xz -> kparts-5.37.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kparts-5.36.0/CMakeLists.txt 
new/kparts-5.37.0/CMakeLists.txt
--- old/kparts-5.36.0/CMakeLists.txt    2017-07-02 10:08:50.000000000 +0200
+++ new/kparts-5.37.0/CMakeLists.txt    2017-08-06 20:08:27.000000000 +0200
@@ -1,22 +1,23 @@
 cmake_minimum_required(VERSION 3.0)
 
-set(KF5_VERSION "5.36.0") # handled by release scripts
-set(KF5_DEP_VERSION "5.36.0") # handled by release scripts
+set(KF5_VERSION "5.37.0") # handled by release scripts
+set(KF5_DEP_VERSION "5.37.0") # handled by release scripts
 project(KParts VERSION ${KF5_VERSION})
 
 include(FeatureSummary)
-find_package(ECM 5.36.0  NO_MODULE)
+find_package(ECM 5.37.0  NO_MODULE)
 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake 
Modules." URL 
"https://projects.kde.org/projects/kdesupport/extra-cmake-modules";)
 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND 
FATAL_ON_MISSING_REQUIRED_PACKAGES)
 
 
 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
 
-set(REQUIRED_QT_VERSION 5.6.0)
+set(REQUIRED_QT_VERSION 5.7.0)
 find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core Widgets Xml)
 include(KDEInstallDirs)
 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
 include(KDECMakeSettings)
+include(KDEPackageAppTemplates)
 include(ECMAddQch)
 
 include(GenerateExportHeader)
@@ -54,6 +55,7 @@
     ki18n_install(po)
 endif()
 add_subdirectory( src )
+add_subdirectory(templates)
 
 # create a Config.cmake and a ConfigVersion.cmake file and install them
 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Parts")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kparts-5.36.0/ExtraDesktop.sh 
new/kparts-5.37.0/ExtraDesktop.sh
--- old/kparts-5.36.0/ExtraDesktop.sh   1970-01-01 01:00:00.000000000 +0100
+++ new/kparts-5.37.0/ExtraDesktop.sh   2017-08-06 20:08:27.000000000 +0200
@@ -0,0 +1,4 @@
+#! /bin/sh
+#This file outputs in a separate line each file with a .desktop syntax
+#that needs to be translated but has a non .desktop extension
+find -name \*.kdevtemplate -print
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kparts-5.36.0/README.md new/kparts-5.37.0/README.md
--- old/kparts-5.36.0/README.md 2017-07-02 10:08:50.000000000 +0200
+++ new/kparts-5.37.0/README.md 2017-08-06 20:08:27.000000000 +0200
@@ -36,6 +36,6 @@
 
 For a complete, and very simple, example of how to use KParts to display
 any kind of file (i.e. making a generic viewer), see the documentation for
-KParts::ComponentFactory::createPartInstanceFromQuery.
+KMimeTypeTrader::createPartInstanceFromQuery().
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kparts-5.36.0/autotests/parttest.cpp 
new/kparts-5.37.0/autotests/parttest.cpp
--- old/kparts-5.36.0/autotests/parttest.cpp    2017-07-02 10:08:50.000000000 
+0200
+++ new/kparts-5.37.0/autotests/parttest.cpp    2017-08-06 20:08:27.000000000 
+0200
@@ -22,6 +22,7 @@
 #include <ksharedconfig.h>
 #include <kparts/readonlypart.h>
 #include <kparts/openurlarguments.h>
+#include <QSignalSpy>
 #include <QTest>
 #include <QWidget>
 
@@ -169,6 +170,23 @@
 
     delete part;
 }
+
+void PartTest::testEmptyUrlAfterCloseUrl()
+{
+    TestPart *part = new TestPart(nullptr, nullptr);
+
+    
QVERIFY(part->openUrl(QUrl::fromLocalFile(QFINDTESTDATA("notepad.desktop"))));
+    QSignalSpy spy(part, &KParts::ReadOnlyPart::urlChanged);
+    QVERIFY(part->openUrl(QUrl::fromLocalFile(QFINDTESTDATA("parttest.cpp"))));
+    QVERIFY(!part->url().isEmpty());
+    QCOMPARE(spy.count(), 1);
+    spy.clear();
+    QVERIFY(part->closeUrl());
+    QVERIFY(part->url().isEmpty());
+    QCOMPARE(spy.count(), 1);
+
+    delete part;
+}
 
 #include <kparts/mainwindow.h>
 #include <ktoolbar.h>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kparts-5.36.0/autotests/parttest.h 
new/kparts-5.37.0/autotests/parttest.h
--- old/kparts-5.36.0/autotests/parttest.h      2017-07-02 10:08:50.000000000 
+0200
+++ new/kparts-5.37.0/autotests/parttest.h      2017-08-06 20:08:27.000000000 
+0200
@@ -33,6 +33,7 @@
 
     void testOpenUrlArguments();
     void testAutomaticMimeType();
+    void testEmptyUrlAfterCloseUrl();
 
     void testToolbarVisibility();
 };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kparts-5.36.0/po/gl/kparts5.po 
new/kparts-5.37.0/po/gl/kparts5.po
--- old/kparts-5.36.0/po/gl/kparts5.po  2017-07-02 10:08:50.000000000 +0200
+++ new/kparts-5.37.0/po/gl/kparts5.po  2017-08-06 20:08:27.000000000 +0200
@@ -9,20 +9,21 @@
 # Marce Villarino <[email protected]>, 2009, 2010, 2011, 2012.
 # Xosé <[email protected]>, 2010.
 # Marce Villarino <[email protected]>, 2011, 2012, 2013, 2014.
+# Adrián Chaves (Gallaecio) <[email protected]>, 2017.
 msgid ""
 msgstr ""
 "Project-Id-Version: kdelibs4\n"
 "Report-Msgid-Bugs-To: http://bugs.kde.org\n";
 "POT-Creation-Date: 2016-11-19 20:12+0100\n"
-"PO-Revision-Date: 2014-01-06 15:27+0100\n"
-"Last-Translator: Marce Villarino <[email protected]>\n"
-"Language-Team: Galician <[email protected]>\n"
+"PO-Revision-Date: 2017-07-27 08:43+0100\n"
+"Last-Translator: Adrián Chaves (Gallaecio) <[email protected]>\n"
+"Language-Team: Galician <[email protected]>\n"
 "Language: gl\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Lokalize 1.5\n"
+"X-Generator: Lokalize 2.0\n"
 "X-Environment: kde, development\n"
 "X-Accelerator-Marker: &\n"
 "X-Text-Markup: kde4\n"
@@ -45,7 +46,7 @@
 #: browserextension.cpp:242
 #, kde-format
 msgid "Internet Search"
-msgstr "Buscar en Internet"
+msgstr "Busca por internet"
 
 #: browserextension.cpp:242
 #, kde-format
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kparts-5.36.0/po/zh_CN/kparts5.po 
new/kparts-5.37.0/po/zh_CN/kparts5.po
--- old/kparts-5.36.0/po/zh_CN/kparts5.po       2017-07-02 10:08:50.000000000 
+0200
+++ new/kparts-5.37.0/po/zh_CN/kparts5.po       2017-08-06 20:08:27.000000000 
+0200
@@ -1,29 +1,20 @@
-# translation of kdelibs4.po to Chinese Simplified
-# Copyright (C) 2007 Free Software Foundation, Inc.
-#
-# Lie Ex <[email protected]> 2007-2011.
-# Wang Jian <[email protected]>, 1998.
-# Sarah Smith <[email protected]>, 2002.
-# Xiong Jiang <[email protected]>, 2002,2003,2004.
-# Funda Wang <[email protected]>, 2002,2003,2004.
-# Liang Qi <[email protected]>, 2007.
-# Feng Chao <[email protected]>, 2010, 2012, 2014.
-# Ni Hui <[email protected]>, 2010, 2011, 2012.
-# Weng Xuetian <[email protected]>, 2011, 2012, 2013.
 msgid ""
 msgstr ""
-"Project-Id-Version: kdelibs4\n"
+"Project-Id-Version: kdeorg\n"
 "Report-Msgid-Bugs-To: http://bugs.kde.org\n";
 "POT-Creation-Date: 2016-11-19 20:12+0100\n"
-"PO-Revision-Date: 2014-03-13 21:01+0800\n"
-"Last-Translator: Feng Chao <[email protected]>\n"
-"Language-Team: Chinese Simplified <[email protected]>\n"
+"PO-Revision-Date: 2017-08-05 09:29-0400\n"
+"Last-Translator: guoyunhebrave <[email protected]>\n"
+"Language-Team: Chinese Simplified\n"
 "Language: zh_CN\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Lokalize 1.5\n"
+"X-Generator: crowdin.com\n"
+"X-Crowdin-Project: kdeorg\n"
+"X-Crowdin-Language: zh-CN\n"
+"X-Crowdin-File: /kf5-trunk/messages/frameworks/kparts5.pot\n"
 
 #, kde-format
 msgctxt "NAME OF TRANSLATORS"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kparts-5.36.0/src/browserview.desktop 
new/kparts-5.37.0/src/browserview.desktop
--- old/kparts-5.36.0/src/browserview.desktop   2017-07-02 10:08:50.000000000 
+0200
+++ new/kparts-5.37.0/src/browserview.desktop   2017-08-06 20:08:27.000000000 
+0200
@@ -98,7 +98,7 @@
 Name[x-test]=xxBrowser Viewxx
 Name[zh_CN]=浏览器视图
 Name[zh_HK]=瀏覽器視圖
-Name[zh_TW]=瀏覽器視圖
+Name[zh_TW]=瀏覽器檢視
 
 # Arguments passed to the factory (e.g. view sub-type)
 [PropertyDef::X-KDE-BrowserView-Args]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kparts-5.36.0/src/mainwindow.h 
new/kparts-5.37.0/src/mainwindow.h
--- old/kparts-5.36.0/src/mainwindow.h  2017-07-02 10:08:50.000000000 +0200
+++ new/kparts-5.37.0/src/mainwindow.h  2017-08-06 20:08:27.000000000 +0200
@@ -63,7 +63,7 @@
     /**
      * Constructor, same signature as KMainWindow.
      */
-    explicit MainWindow(QWidget *parent = nullptr, Qt::WindowFlags f = 
KDE_DEFAULT_WINDOWFLAGS);
+    explicit MainWindow(QWidget *parent = nullptr, Qt::WindowFlags f = 
Qt::WindowFlags());
     /**
      * Destructor.
      */
@@ -89,7 +89,7 @@
     /**
      * Enable or disable the automatic setting of window titles by the part's 
document title.
      * By default, a part always changes the window title when the document 
changes.
-     * @note This value must be set before calling @see createGUI.
+     * @note This value must be set before calling createGUI().
      *
      * @param enabled boolean to enable or disable the window title handling
      * @since 5.24
@@ -104,7 +104,7 @@
     virtual void slotSetStatusBarText(const QString &);
 
     /**
-     * Rebuilds the GUI after KEditToolbar changed the toolbar layout.
+     * Rebuilds the GUI after KEditToolBar changed the toolbar layout.
      * @see configureToolbars()
      */
     void saveNewToolbarConfig() Q_DECL_OVERRIDE;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kparts-5.36.0/src/readonlypart.cpp 
new/kparts-5.37.0/src/readonlypart.cpp
--- old/kparts-5.36.0/src/readonlypart.cpp      2017-07-02 10:08:50.000000000 
+0200
+++ new/kparts-5.37.0/src/readonlypart.cpp      2017-08-06 20:08:27.000000000 
+0200
@@ -137,7 +137,10 @@
         d->m_bAutoDetectedMime = false;
     }
     OpenUrlArguments args = d->m_arguments;
-    if (!closeUrl()) {
+    d->m_closeUrlFromOpenUrl = true;
+    const bool closed = closeUrl();
+    d->m_closeUrlFromOpenUrl = false;
+    if (!closed) {
         return false;
     }
     d->m_arguments = args;
@@ -245,6 +248,9 @@
     abortLoad(); //just in case
 
     d->m_arguments = KParts::OpenUrlArguments();
+    if (!d->m_closeUrlFromOpenUrl) {
+        setUrl(QUrl());
+    }
 
     if (d->m_bTemp) {
         QFile::remove(d->m_file);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kparts-5.36.0/src/readonlypart.h 
new/kparts-5.37.0/src/readonlypart.h
--- old/kparts-5.36.0/src/readonlypart.h        2017-07-02 10:08:50.000000000 
+0200
+++ new/kparts-5.37.0/src/readonlypart.h        2017-08-06 20:08:27.000000000 
+0200
@@ -111,7 +111,9 @@
 
 public:
     /**
-     *  Returns the URL currently opened in this part.
+     * Returns the URL currently opened in (or being opened by) this part.
+     * @note url() is not cleared if openUrl() fails to load the URL.
+     *       Call closeUrl() if you need to explicitly reset it.
      *
      *  @return The current URL.
      */
@@ -123,6 +125,7 @@
      * automatically in this case).
      * If the current URL is not fully loaded yet, aborts loading.
      * Deletes the temporary file used when the url is remote.
+     * Resets the current url() to QUrl().
      * @return always true, but the return value exists for reimplementations
      */
     virtual bool closeUrl();
@@ -248,6 +251,11 @@
      * If the part uses the standard implementation of openUrl(),
      * it must reimplement this, to open the local file.
      * The default implementation is simply { return false; }
+     *
+     * If this method returns true, the part emits completed(),
+     * otherwise it emits canceled().
+     *
+     * @see completed(), canceled()
      */
     virtual bool openFile();
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kparts-5.36.0/src/readonlypart_p.h 
new/kparts-5.37.0/src/readonlypart_p.h
--- old/kparts-5.36.0/src/readonlypart_p.h      2017-07-02 10:08:50.000000000 
+0200
+++ new/kparts-5.37.0/src/readonlypart_p.h      2017-08-06 20:08:27.000000000 
+0200
@@ -50,6 +50,7 @@
         m_duringSaveAs = false;
         m_bTemp = false;
         m_bAutoDetectedMime = false;
+        m_closeUrlFromOpenUrl = false;
     }
 
     ~ReadOnlyPartPrivate()
@@ -79,6 +80,8 @@
 
     // whether the mimetype in the arguments was detected by the part itself
     bool m_bAutoDetectedMime : 1;
+    // Whether we are calling closeUrl() from openUrl().
+    bool m_closeUrlFromOpenUrl;
 
     /**
      * Remote (or local) url - the one displayed to the user.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kparts-5.36.0/templates/CMakeLists.txt 
new/kparts-5.37.0/templates/CMakeLists.txt
--- old/kparts-5.36.0/templates/CMakeLists.txt  1970-01-01 01:00:00.000000000 
+0100
+++ new/kparts-5.37.0/templates/CMakeLists.txt  2017-08-06 20:08:27.000000000 
+0200
@@ -0,0 +1,5 @@
+set(apptemplate_DIRS
+    kpartsapp
+)
+
+kde_package_app_templates(TEMPLATES ${apptemplate_DIRS} INSTALL_DIR 
${KDE_INSTALL_KTEMPLATESDIR})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kparts-5.36.0/templates/kpartsapp/CMakeLists.txt 
new/kparts-5.37.0/templates/kpartsapp/CMakeLists.txt
--- old/kparts-5.36.0/templates/kpartsapp/CMakeLists.txt        1970-01-01 
01:00:00.000000000 +0100
+++ new/kparts-5.37.0/templates/kpartsapp/CMakeLists.txt        2017-08-06 
20:08:27.000000000 +0200
@@ -0,0 +1,29 @@
+cmake_minimum_required(VERSION 3.0)
+
+project(%{APPNAMELC})
+
+set(REQUIRED_ECM_VERSION "5.23.0")
+find_package(ECM ${REQUIRED_ECM_VERSION} REQUIRED NO_MODULE)
+set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
+
+include(KDEInstallDirs)
+include(KDECMakeSettings)
+include(KDECompilerSettings NO_POLICY_SCOPE)
+include(ECMInstallIcons)
+include(FeatureSummary)
+
+set(QT_MIN_VERSION "5.6.0")
+find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
+    Widgets
+)
+
+set(REQUIRED_KF5_VERSION "5.23.0")
+find_package(KF5 ${REQUIRED_KF5_VERSION} REQUIRED COMPONENTS
+    I18n
+    Parts
+)
+
+add_subdirectory(src)
+add_subdirectory(icons)
+
+feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES 
FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kparts-5.36.0/templates/kpartsapp/README 
new/kparts-5.37.0/templates/kpartsapp/README
--- old/kparts-5.36.0/templates/kpartsapp/README        1970-01-01 
01:00:00.000000000 +0100
+++ new/kparts-5.37.0/templates/kpartsapp/README        2017-08-06 
20:08:27.000000000 +0200
@@ -0,0 +1,46 @@
+How To Build This Project
+-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+--- On Unix:
+
+cd %{dest}
+mkdir build
+cd build
+cmake -DCMAKE_INSTALL_PREFIX=$PROJECTINSTALLDIR -DCMAKE_BUILD_TYPE=Debug ..    
  <- do not forget the ..
+make
+make install or su -c 'make install'
+
+where $PROJECTINSTALLDIR points to your installation prefix.
+
+to uninstall the project:
+make uninstall or su -c 'make uninstall'
+
+Note: you can use another build path. Then cd in your build dir and:
+export KDE_SRC=path_to_your_src
+cmake $KDE_SRC -DCMAKE_INSTALL_PREFIX=$PROJECTINSTALLDIR 
-DCMAKE_BUILD_TYPE=Debug
+
+--- On Windows:
+
+cd %{dest}
+mkdir build
+cd build
+cmake -DCMAKE_INSTALL_PREFIX=%PROJECTINSTALLDIR% -DCMAKE_BUILD_TYPE=Debug ..   
   <- do not forget the ..
+[n]make
+[n]make install
+
+where %PROJECTINSTALLDIR% points to your installation prefix.
+
+to uninstall the project:
+[n]make uninstall
+
+Note: use nmake if you're building with the Visual Studio compiler, or make
+if you're using the minGW compiler
+
+
+Tutorials
+-=-=-=-=-
+KParts docs
+https://techbase.kde.org/Development/Architecture/KDE4/KParts
+https://api.kde.org/frameworks/kparts/html/index.html
+Tutorial
+https://techbase.kde.org/Development/Tutorials/Using_KParts
Binary files 
old/kparts-5.36.0/templates/kpartsapp/icons/16-apps-%{APPNAMELC}.png and 
new/kparts-5.37.0/templates/kpartsapp/icons/16-apps-%{APPNAMELC}.png differ
Binary files 
old/kparts-5.36.0/templates/kpartsapp/icons/32-apps-%{APPNAMELC}.png and 
new/kparts-5.37.0/templates/kpartsapp/icons/32-apps-%{APPNAMELC}.png differ
Binary files 
old/kparts-5.36.0/templates/kpartsapp/icons/48-apps-%{APPNAMELC}.png and 
new/kparts-5.37.0/templates/kpartsapp/icons/48-apps-%{APPNAMELC}.png differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kparts-5.36.0/templates/kpartsapp/icons/CMakeLists.txt 
new/kparts-5.37.0/templates/kpartsapp/icons/CMakeLists.txt
--- old/kparts-5.36.0/templates/kpartsapp/icons/CMakeLists.txt  1970-01-01 
01:00:00.000000000 +0100
+++ new/kparts-5.37.0/templates/kpartsapp/icons/CMakeLists.txt  2017-08-06 
20:08:27.000000000 +0200
@@ -0,0 +1,7 @@
+set(%{APPNAMELC}_ICONS
+  16-apps-%{APPNAMELC}.png
+  32-apps-%{APPNAMELC}.png
+  48-apps-%{APPNAMELC}.png
+)
+
+ecm_install_icons(ICONS ${%{APPNAMELC}_ICONS} DESTINATION 
${KDE_INSTALL_ICONDIR} THEME hicolor)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kparts-5.36.0/templates/kpartsapp/kpartsapp.kdevtemplate 
new/kparts-5.37.0/templates/kpartsapp/kpartsapp.kdevtemplate
--- old/kparts-5.36.0/templates/kpartsapp/kpartsapp.kdevtemplate        
1970-01-01 01:00:00.000000000 +0100
+++ new/kparts-5.37.0/templates/kpartsapp/kpartsapp.kdevtemplate        
2017-08-06 20:08:27.000000000 +0200
@@ -0,0 +1,40 @@
+# KDE Config File
+[General]
+Name=KParts Application
+Name[ca]=Aplicació de les KParts
+Name[ca@valencia]=Aplicació de les KParts
+Name[es]=Aplicación de KParts
+Name[fi]=KParts-sovellus
+Name[gl]=Aplicativo de KParts
+Name[it]=Applicazione KParts
+Name[nl]=KParts-toepassing
+Name[pt]=Aplicação do KParts
+Name[sl]=Program KParts
+Name[sr]=К‑деони програм
+Name[sr@ijekavian]=К‑диони програм
+Name[sr@ijekavianlatin]=K‑dioni program
+Name[sr@latin]=K‑deoni program
+Name[sv]=KParts-program
+Name[uk]=Програма KParts
+Name[x-test]=xxKParts Applicationxx
+Name[zh_TW]=KParts 應用程式
+Comment=Generate an application built on the KParts framework, using CMake.
+Comment[ca]=Genera una construcció d'aplicació en el Framework KParts, usant 
el CMake.
+Comment[ca@valencia]=Genera una construcció d'aplicació en el Framework 
KParts, usant el CMake.
+Comment[es]=Generar una construcción de aplicación sobre la infraestructura 
KParts, usando CMake.
+Comment[fi]=Luo KParts-sovelluskehykseen pohjautuva sovellus käyttäen CMakea.
+Comment[gl]=Xerar un apliactivo construído coa infraestrutura KParts, usando 
CMake.
+Comment[it]=Genera un'applicazione basata sul framework KParts, utilizzando 
CMake.
+Comment[nl]=Genereer een toepassing gebouwd op het KParts-framework met CMake.
+Comment[pt]=Gera uma aplicação compilada com a plataforma do KParts, usando o 
CMake.
+Comment[sr]=Генерише програм над радним оквиром К‑делова, користећи Ц‑мејк
+Comment[sr@ijekavian]=Генерише програм над радним оквиром К‑дијелова, 
користећи Ц‑мејк
+Comment[sr@ijekavianlatin]=Generiše program nad radnim okvirom K‑dijelova, 
koristeći CMake
+Comment[sr@latin]=Generiše program nad radnim okvirom K‑delova, koristeći CMake
+Comment[sv]=Skapa ett program byggt på KParts-ramverket, med användning av 
CMake.
+Comment[uk]=Створити програму на основі бібліотек KParts з використанням CMake.
+Comment[x-test]=xxGenerate an application built on the KParts framework, using 
CMake.xx
+Comment[zh_TW]=使用 CMake 生成一個建基於 KParts 框架的應用程式。
+Category=Qt/Graphical
+Icon=kpartsapp.png
+ShowFilesAfterGeneration=%{dest}/src/shell/main.cpp
Binary files old/kparts-5.36.0/templates/kpartsapp/kpartsapp.png and 
new/kparts-5.37.0/templates/kpartsapp/kpartsapp.png differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kparts-5.36.0/templates/kpartsapp/src/CMakeLists.txt 
new/kparts-5.37.0/templates/kpartsapp/src/CMakeLists.txt
--- old/kparts-5.36.0/templates/kpartsapp/src/CMakeLists.txt    1970-01-01 
01:00:00.000000000 +0100
+++ new/kparts-5.37.0/templates/kpartsapp/src/CMakeLists.txt    2017-08-06 
20:08:27.000000000 +0200
@@ -0,0 +1,2 @@
+add_subdirectory(part)
+add_subdirectory(shell)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kparts-5.36.0/templates/kpartsapp/src/part/%{APPNAMELC}part.cpp 
new/kparts-5.37.0/templates/kpartsapp/src/part/%{APPNAMELC}part.cpp
--- old/kparts-5.36.0/templates/kpartsapp/src/part/%{APPNAMELC}part.cpp 
1970-01-01 01:00:00.000000000 +0100
+++ new/kparts-5.37.0/templates/kpartsapp/src/part/%{APPNAMELC}part.cpp 
2017-08-06 20:08:27.000000000 +0200
@@ -0,0 +1,167 @@
+/*
+ *   Copyright (C) %{CURRENT_YEAR} by %{AUTHOR} <%{EMAIL}>
+ *
+ *   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 "%{APPNAMELC}part.h"
+
+// KF headers
+#include <KPluginFactory>
+#include <KAboutData>
+#include <KLocalizedString>
+#include <KActionCollection>
+#include <KStandardAction>
+
+// Qt headers
+#include <QFileDialog>
+#include <QFile>
+#include <QTextStream>
+#include <QTextEdit>
+#include <QTextDocument>
+
+K_PLUGIN_FACTORY(%{APPNAME}PartFactory, registerPlugin<%{APPNAME}Part>();)
+
+
+%{APPNAME}Part::%{APPNAME}Part(QWidget* parentWidget, QObject* parent, const 
QVariantList& /*args*/)
+    : KParts::ReadWritePart(parent)
+{
+    // set component data
+    // the first arg must be the same as the subdirectory into which the 
part's rc file is installed
+    KAboutData aboutData("%{APPNAMELC}part", i18n("%{APPNAME}Part"), 
QStringLiteral("%{VERSION}"));
+    aboutData.addAuthor(i18n("%{AUTHOR}"), i18n("Author"), 
QStringLiteral("%{EMAIL}"));
+    setComponentData(aboutData);
+
+    // set internal UI
+    // TODO: replace with your custom UI
+    m_textEditWidget = new QTextEdit(parentWidget);
+    setWidget(m_textEditWidget);
+
+    // set KXMLUI resource file
+    setXMLFile(QStringLiteral("%{APPNAMELC}partui.rc"));
+
+    // setup actions
+    setupActions();
+
+    // starting with empty data model, not modified at begin
+    // TODO: replace with your custom data model
+    m_textDocument = new QTextDocument(this);
+    m_textEditWidget->setDocument(m_textDocument);
+    setModified(false);
+
+    // set part read-write by default
+    setReadWrite(true);
+}
+
+%{APPNAME}Part::~%{APPNAME}Part()
+{
+}
+
+void %{APPNAME}Part::setupActions()
+{
+    m_saveAction = KStandardAction::save(this, &%{APPNAME}Part::fileSave, 
actionCollection());
+    KStandardAction::saveAs(this, &%{APPNAME}Part::fileSaveAs, 
actionCollection());
+}
+
+void %{APPNAME}Part::setReadWrite(bool rw)
+{
+    // update internal UI
+    m_textEditWidget->setReadOnly(!rw);
+
+    // connect to modified state of data model
+    if (rw) {
+        connect(m_textDocument, &QTextDocument::modificationChanged,
+                this,     &%{APPNAME}Part::setModified);
+    } else {
+        disconnect(m_textDocument, &QTextDocument::modificationChanged,
+                   this,     &%{APPNAME}Part::setModified);
+    }
+
+    ReadWritePart::setReadWrite(rw);
+}
+
+void %{APPNAME}Part::setModified(bool modified)
+{
+    // update actions
+    m_saveAction->setEnabled(modified);
+
+    ReadWritePart::setModified(modified);
+}
+
+bool %{APPNAME}Part::openFile()
+{
+    QFile file(localFilePath());
+    if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+        return false;
+    }
+
+    // TODO: replace with your custom file reading
+    QTextStream stream(&file);
+    QString text;
+    while (!stream.atEnd()) {
+        text += stream.readLine() + QLatin1Char('\n');
+    }
+
+    file.close();
+
+    m_textDocument->setPlainText(text);
+
+    return true;
+}
+
+bool %{APPNAME}Part::saveFile()
+{
+    // protect against wrong calls, as recommended in the ReadWritePart API dox
+    if (!isReadWrite()) {
+        return false;
+    }
+
+    QFile file(localFilePath());
+    if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
+        return false;
+    }
+
+    // TODO: replace with your custom file writing
+    QTextStream stream(&file);
+    stream << m_textDocument->toPlainText();
+
+    file.close();
+
+    // set current state in the data model as saved
+    m_textDocument->setModified(false);
+
+    return true;
+}
+
+void %{APPNAME}Part::fileSave()
+{
+    if (url().isValid()) {
+        save();
+    } else {
+        fileSaveAs();
+    }
+}
+
+void %{APPNAME}Part::fileSaveAs()
+{
+    const QUrl url = QFileDialog::getSaveFileUrl();
+    if (url.isValid()) {
+        saveAs(url);
+    }
+}
+
+// needed for K_PLUGIN_FACTORY
+#include <%{APPNAMELC}part.moc>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kparts-5.36.0/templates/kpartsapp/src/part/%{APPNAMELC}part.desktop 
new/kparts-5.37.0/templates/kpartsapp/src/part/%{APPNAMELC}part.desktop
--- old/kparts-5.36.0/templates/kpartsapp/src/part/%{APPNAMELC}part.desktop     
1970-01-01 01:00:00.000000000 +0100
+++ new/kparts-5.37.0/templates/kpartsapp/src/part/%{APPNAMELC}part.desktop     
2017-08-06 20:08:27.000000000 +0200
@@ -0,0 +1,29 @@
+[Desktop Entry]
+Type=Service
+Name=%{APPNAME}Part
+Name[ca]=%{APPNAME}Part
+Name[ca@valencia]=%{APPNAME}Part
+Name[cs]=%{APPNAME}Part
+Name[es]=%{APPNAME}Part
+Name[fi]=%{APPNAME}-osa
+Name[gl]=%{APPNAME}Part
+Name[it]=%{APPNAME}Part
+Name[nb]=%{APPNAME}-del
+Name[nl]=%{APPNAME}Part
+Name[nn]=%{APPNAME}-del
+Name[pt]=%{APPNAME}Part
+Name[sl]=%{APPNAME}Part
+Name[sr]=%{APPNAME}Part
+Name[sr@ijekavian]=%{APPNAME}Part
+Name[sr@ijekavianlatin]=%{APPNAME}Part
+Name[sr@latin]=%{APPNAME}Part
+Name[sv]=%{APPNAME}-delprogram
+Name[uk]=%{APPNAME}Part
+Name[x-test]=xx%{APPNAME}Partxx
+Name[zh_CN]=%{APPNAME}Part
+Name[zh_TW]=%{APPNAME}Part
+Icon=%{APPNAMELC}
+# TODO: replace with your custom supported mime types
+MimeType=text/plain;
+X-KDE-ServiceTypes=KParts/ReadOnlyPart,KParts/ReadWritePart
+X-KDE-Library=%{APPNAMELC}part
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kparts-5.36.0/templates/kpartsapp/src/part/%{APPNAMELC}part.h 
new/kparts-5.37.0/templates/kpartsapp/src/part/%{APPNAMELC}part.h
--- old/kparts-5.36.0/templates/kpartsapp/src/part/%{APPNAMELC}part.h   
1970-01-01 01:00:00.000000000 +0100
+++ new/kparts-5.37.0/templates/kpartsapp/src/part/%{APPNAMELC}part.h   
2017-08-06 20:08:27.000000000 +0200
@@ -0,0 +1,76 @@
+/*
+ *   Copyright (C) %{CURRENT_YEAR} by %{AUTHOR} <%{EMAIL}>
+ *
+ *   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 .
+ */
+
+#ifndef %{APPNAMEUC}PART_H
+#define %{APPNAMEUC}PART_H
+
+// KF headers
+#include <KParts/ReadWritePart>
+
+class QTextEdit;
+class QWidget;
+class QAction;
+class QTextDocument;
+
+/**
+ * @short %{APPNAME} Part
+ */
+class %{APPNAME}Part : public KParts::ReadWritePart
+{
+    Q_OBJECT
+
+public:
+    /**
+     * Default constructor, with arguments as expected by KPluginFactory
+     */
+    %{APPNAME}Part(QWidget* parentWidget, QObject* parent, const QVariantList& 
arg);
+
+    /**
+     * Destructor
+     */
+    ~%{APPNAME}Part() override;
+
+    /**
+     * Reimplemented to update the internal UI
+     */
+    void setReadWrite(bool rw) override;
+
+    /**
+     * Reimplemented to disable and enable Save action
+     */
+    void setModified(bool modified) override;
+
+protected: // KParts::ReadWritePart API
+    bool openFile() override;
+    bool saveFile() override;
+
+private:
+    void setupActions();
+
+private Q_SLOTS:
+    void fileSave();
+    void fileSaveAs();
+
+private:
+    QTextEdit* m_textEditWidget;
+    QAction* m_saveAction;
+    QTextDocument* m_textDocument;
+};
+
+#endif // %{APPNAMEUC}PART_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kparts-5.36.0/templates/kpartsapp/src/part/%{APPNAMELC}partui.rc 
new/kparts-5.37.0/templates/kpartsapp/src/part/%{APPNAMELC}partui.rc
--- old/kparts-5.36.0/templates/kpartsapp/src/part/%{APPNAMELC}partui.rc        
1970-01-01 01:00:00.000000000 +0100
+++ new/kparts-5.37.0/templates/kpartsapp/src/part/%{APPNAMELC}partui.rc        
2017-08-06 20:08:27.000000000 +0200
@@ -0,0 +1,13 @@
+<!DOCTYPE gui SYSTEM "kpartgui.dtd">
+<gui name="%{APPNAMELC}part" version="1">
+<MenuBar>
+  <Menu name="file">
+    <Action name="file_save"/>
+    <Action name="file_save_as"/>
+  </Menu>
+</MenuBar>
+<ToolBar name="mainToolBar">
+  <Action name="file_save"/>
+  <Separator/>
+</ToolBar>
+</gui>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kparts-5.36.0/templates/kpartsapp/src/part/CMakeLists.txt 
new/kparts-5.37.0/templates/kpartsapp/src/part/CMakeLists.txt
--- old/kparts-5.36.0/templates/kpartsapp/src/part/CMakeLists.txt       
1970-01-01 01:00:00.000000000 +0100
+++ new/kparts-5.37.0/templates/kpartsapp/src/part/CMakeLists.txt       
2017-08-06 20:08:27.000000000 +0200
@@ -0,0 +1,16 @@
+add_definitions(-DTRANSLATION_DOMAIN=\"%{APPNAMELC}part\")
+
+set(%{APPNAMELC}_PART_SRCS
+   %{APPNAMELC}part.cpp
+)
+
+add_library(%{APPNAMELC}part MODULE ${%{APPNAMELC}_PART_SRCS})
+
+target_link_libraries(%{APPNAMELC}part
+    KF5::I18n
+    KF5::Parts
+)
+
+install(TARGETS %{APPNAMELC}part  DESTINATION ${KDE_INSTALL_PLUGINDIR})
+install(PROGRAMS %{APPNAMELC}part.desktop  DESTINATION ${KDE_INSTALL_APPDIR})
+install(FILES %{APPNAMELC}partui.rc  DESTINATION  
${KDE_INSTALL_KXMLGUI5DIR}/%{APPNAMELC}part)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kparts-5.36.0/templates/kpartsapp/src/part/Messages.sh 
new/kparts-5.37.0/templates/kpartsapp/src/part/Messages.sh
--- old/kparts-5.36.0/templates/kpartsapp/src/part/Messages.sh  1970-01-01 
01:00:00.000000000 +0100
+++ new/kparts-5.37.0/templates/kpartsapp/src/part/Messages.sh  2017-08-06 
20:08:27.000000000 +0200
@@ -0,0 +1,3 @@
+#! /usr/bin/env bash
+$EXTRACTRC `find . -name \*.rc` >> rc.cpp
+$XGETTEXT `find . -name \*.cpp` -o $podir/%{APPNAMELC}part.pot
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kparts-5.36.0/templates/kpartsapp/src/shell/%{APPNAMELC}.desktop 
new/kparts-5.37.0/templates/kpartsapp/src/shell/%{APPNAMELC}.desktop
--- old/kparts-5.36.0/templates/kpartsapp/src/shell/%{APPNAMELC}.desktop        
1970-01-01 01:00:00.000000000 +0100
+++ new/kparts-5.37.0/templates/kpartsapp/src/shell/%{APPNAMELC}.desktop        
2017-08-06 20:08:27.000000000 +0200
@@ -0,0 +1,28 @@
+[Desktop Entry]
+Type=Application
+Name=%{APPNAME}
+Name[ca]=%{APPNAME}
+Name[ca@valencia]=%{APPNAME}
+Name[cs]=%{APPNAME}
+Name[es]=%{APPNAME}
+Name[fi]=%{APPNAME}
+Name[gl]=%{APPNAME}
+Name[it]=%{APPNAME}
+Name[nb]=%{APPNAME}
+Name[nl]=%{APPNAME}
+Name[nn]=%{APPNAME}
+Name[pt]=%{APPNAME}
+Name[sl]=%{APPNAME}
+Name[sr]=%{APPNAME}
+Name[sr@ijekavian]=%{APPNAME}
+Name[sr@ijekavianlatin]=%{APPNAME}
+Name[sr@latin]=%{APPNAME}
+Name[sv]=%{APPNAME}
+Name[uk]=%{APPNAME}
+Name[x-test]=xx%{APPNAME}xx
+Name[zh_TW]=%{APPNAME}
+Icon=%{APPNAMELC}
+# TODO: replace with your custom supported mime types
+MimeType=text/plain;
+Exec=%{APPNAMELC} %U
+Terminal=false
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kparts-5.36.0/templates/kpartsapp/src/shell/%{APPNAMELC}shell.cpp 
new/kparts-5.37.0/templates/kpartsapp/src/shell/%{APPNAMELC}shell.cpp
--- old/kparts-5.36.0/templates/kpartsapp/src/shell/%{APPNAMELC}shell.cpp       
1970-01-01 01:00:00.000000000 +0100
+++ new/kparts-5.37.0/templates/kpartsapp/src/shell/%{APPNAMELC}shell.cpp       
2017-08-06 20:08:27.000000000 +0200
@@ -0,0 +1,110 @@
+/*
+ *   Copyright (C) %{CURRENT_YEAR} by %{AUTHOR} <%{EMAIL}>
+ *
+ *   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 "%{APPNAMELC}shell.h"
+
+// KF headers
+#include <KParts/ReadWritePart>
+#include <KPluginLoader>
+#include <KPluginFactory>
+#include <KActionCollection>
+#include <KStandardAction>
+#include <KLocalizedString>
+#include <KMessageBox>
+
+// Qt headers
+#include <QApplication>
+#include <QFileDialog>
+
+%{APPNAME}Shell::%{APPNAME}Shell()
+    : KParts::MainWindow()
+{
+    // set KXMLUI resource file
+    setXMLFile(QStringLiteral("%{APPNAMELC}ui.rc"));
+
+    // setup our actions
+    setupActions();
+
+    // find and load the part
+    // Doing it by name, which is a bad idea usually but alright here
+    // since this part is made for this shell
+    KPluginLoader loader(QStringLiteral("%{APPNAMELC}part"));
+    auto factory = loader.factory();
+    if (!factory) {
+        // can't do anything useful without part, thus quit the app
+        KMessageBox::error(this, i18n("Could not find %{APPNAME} part!"));
+
+        qApp->quit();
+        // return here, because qApp->quit() only means "exit the
+        // next time we enter the event loop...
+        return;
+    }
+
+    m_part = factory->create<KParts::ReadWritePart>(this);
+
+    if (m_part) {
+        // integrate and setup
+        setCentralWidget(m_part->widget());
+        setupGUI(ToolBar | Keys | StatusBar | Save);
+        createGUI(m_part);
+    }
+}
+
+%{APPNAME}Shell::~%{APPNAME}Shell()
+{
+}
+
+void %{APPNAME}Shell::loadDocument(const QUrl& url)
+{
+    m_part->openUrl(url);
+}
+
+void %{APPNAME}Shell::setupActions()
+{
+    KStandardAction::openNew(this, &%{APPNAME}Shell::fileNew, 
actionCollection());
+    KStandardAction::open(this, &%{APPNAME}Shell::fileOpen, 
actionCollection());
+
+    KStandardAction::quit(qApp, &QApplication::closeAllWindows, 
actionCollection());
+}
+
+void %{APPNAME}Shell::fileNew()
+{
+    // open a new window if the document is _not_ in its initial state
+    if (!m_part->url().isValid() || m_part->isModified()) {
+        (new %{APPNAME}Shell)->show();
+    };
+}
+
+void %{APPNAME}Shell::fileOpen()
+{
+    const QUrl url = QFileDialog::getOpenFileUrl(this);
+
+    if (url.isValid()) {
+        // open a new window if the document is _not_ in its initial state
+        if (!m_part->url().isValid() || m_part->isModified()) {
+            // open the file in a new window
+            auto window = new %{APPNAME}Shell;
+            window->loadDocument(url);
+            window->show();
+        } else {
+            // open the file in this window
+            loadDocument(url);
+        }
+    }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kparts-5.36.0/templates/kpartsapp/src/shell/%{APPNAMELC}shell.h 
new/kparts-5.37.0/templates/kpartsapp/src/shell/%{APPNAMELC}shell.h
--- old/kparts-5.36.0/templates/kpartsapp/src/shell/%{APPNAMELC}shell.h 
1970-01-01 01:00:00.000000000 +0100
+++ new/kparts-5.37.0/templates/kpartsapp/src/shell/%{APPNAMELC}shell.h 
2017-08-06 20:08:27.000000000 +0200
@@ -0,0 +1,64 @@
+/*
+ *   Copyright (C) %{CURRENT_YEAR} by %{AUTHOR} <%{EMAIL}>
+ *
+ *   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 .
+ */
+
+#ifndef %{APPNAMEUC}SHELL_H
+#define %{APPNAMEUC}SHELL_H
+
+// KF headers
+#include <KParts/MainWindow>
+
+namespace KParts {
+class ReadWritePart;
+}
+
+/**
+ * @short %{APPNAME} Shell
+ */
+class %{APPNAME}Shell : public KParts::MainWindow
+{
+    Q_OBJECT
+public:
+    /**
+     * Default Constructor
+     */
+    %{APPNAME}Shell();
+
+    /**
+     * Default Destructor
+     */
+    ~%{APPNAME}Shell() override;
+
+    /**
+     * Use this method to load whatever file/URL you have
+     * @param url document to load
+     */
+    void loadDocument(const QUrl& url);
+
+private Q_SLOTS:
+    void fileNew();
+    void fileOpen();
+
+private:
+    void setupActions();
+
+private:
+    KParts::ReadWritePart* m_part;
+};
+
+#endif // %{APPNAMEUC}_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kparts-5.36.0/templates/kpartsapp/src/shell/%{APPNAMELC}ui.rc 
new/kparts-5.37.0/templates/kpartsapp/src/shell/%{APPNAMELC}ui.rc
--- old/kparts-5.36.0/templates/kpartsapp/src/shell/%{APPNAMELC}ui.rc   
1970-01-01 01:00:00.000000000 +0100
+++ new/kparts-5.37.0/templates/kpartsapp/src/shell/%{APPNAMELC}ui.rc   
2017-08-06 20:08:27.000000000 +0200
@@ -0,0 +1,30 @@
+<!DOCTYPE gui SYSTEM "kpartgui.dtd">
+<gui name="%{APPNAMELC}" version="1">
+<MenuBar>
+  <Menu noMerge="1" name="file"><text>&amp;File</text>
+    <Action name="file_new"/>
+    <Action name="file_open"/>
+    <Separator/>
+    <Merge/>
+    <Separator/>
+    <Action name="file_quit"/>
+  </Menu>
+  <Menu noMerge="1" name="settings"><text>&amp;Settings</text>
+    <Action name="options_show_toolbar"/>
+    <Action name="options_show_statusbar"/>
+    <Merge name="show_merge"/>
+    <Separator/>
+    <Action name="options_configure_keybinding"/>
+    <Action name="options_configure_toolbars"/>
+    <Action name="options_configure"/>
+    <Merge name="configure_merge"/>
+    <Separator/>
+    <Merge/>
+  </Menu>
+</MenuBar>
+<ToolBar noMerge="1" name="mainToolBar"><text>Main Toolbar</text>
+  <Action name="file_new"/>
+  <Action name="file_open"/>
+  <Merge/>
+</ToolBar>
+</gui>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kparts-5.36.0/templates/kpartsapp/src/shell/CMakeLists.txt 
new/kparts-5.37.0/templates/kpartsapp/src/shell/CMakeLists.txt
--- old/kparts-5.36.0/templates/kpartsapp/src/shell/CMakeLists.txt      
1970-01-01 01:00:00.000000000 +0100
+++ new/kparts-5.37.0/templates/kpartsapp/src/shell/CMakeLists.txt      
2017-08-06 20:08:27.000000000 +0200
@@ -0,0 +1,15 @@
+set(%{APPNAMELC}_SRCS
+   main.cpp
+   %{APPNAMELC}shell.cpp
+)
+
+add_executable(%{APPNAMELC} ${%{APPNAMELC}_SRCS})
+
+target_link_libraries(%{APPNAMELC}
+    KF5::I18n
+    KF5::Parts
+)
+
+install(TARGETS %{APPNAMELC} ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
+install(PROGRAMS %{APPNAMELC}.desktop  DESTINATION  ${KDE_INSTALL_APPDIR})
+install(FILES %{APPNAMELC}ui.rc  DESTINATION  
${KDE_INSTALL_KXMLGUI5DIR}/%{APPNAMELC})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kparts-5.36.0/templates/kpartsapp/src/shell/Messages.sh 
new/kparts-5.37.0/templates/kpartsapp/src/shell/Messages.sh
--- old/kparts-5.36.0/templates/kpartsapp/src/shell/Messages.sh 1970-01-01 
01:00:00.000000000 +0100
+++ new/kparts-5.37.0/templates/kpartsapp/src/shell/Messages.sh 2017-08-06 
20:08:27.000000000 +0200
@@ -0,0 +1,3 @@
+#! /usr/bin/env bash
+$EXTRACTRC `find . -name \*.rc` >> rc.cpp
+$XGETTEXT `find . -name \*.cpp` -o $podir/%{APPNAMELC}.pot
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kparts-5.36.0/templates/kpartsapp/src/shell/main.cpp 
new/kparts-5.37.0/templates/kpartsapp/src/shell/main.cpp
--- old/kparts-5.36.0/templates/kpartsapp/src/shell/main.cpp    1970-01-01 
01:00:00.000000000 +0100
+++ new/kparts-5.37.0/templates/kpartsapp/src/shell/main.cpp    2017-08-06 
20:08:27.000000000 +0200
@@ -0,0 +1,75 @@
+/*
+ *   Copyright (C) %{CURRENT_YEAR} by %{AUTHOR} <%{EMAIL}>
+ *
+ *   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 "%{APPNAMELC}shell.h"
+
+// KF headers
+#include <KAboutData>
+#include <KLocalizedString>
+
+// Qt headers
+#include <QApplication>
+#include <QCommandLineParser>
+#include <QUrl>
+#include <QDir>
+#include <QIcon>
+
+int main(int argc, char **argv)
+{
+    QApplication app(argc, argv);
+
+    KLocalizedString::setApplicationDomain("%{APPNAMELC}");
+
+    KAboutData aboutData(QStringLiteral("%{APPNAMELC}"),
+        i18n("%{APPNAME}"),
+        QStringLiteral("%{VERSION}"),
+        i18n("A KPart Application"),
+        KAboutLicense::GPL,
+        i18n("Copyright %{CURRENT_YEAR} %{AUTHOR}"));
+    aboutData.addAuthor(i18n("%{AUTHOR}"), i18n("Author"), 
QStringLiteral("%{EMAIL}"));
+    aboutData.setOrganizationDomain("example.org");
+    aboutData.setDesktopFileName(QStringLiteral("org.example.%{APPNAMELC}"));
+
+    KAboutData::setApplicationData(aboutData);
+    app.setWindowIcon(QIcon::fromTheme(QStringLiteral("%{APPNAMELC}")));
+
+    QCommandLineParser parser;
+    parser.addHelpOption();
+    parser.addVersionOption();
+    aboutData.setupCommandLine(&parser);
+    parser.addPositionalArgument(QStringLiteral("urls"), i18n("Document(s) to 
load."), QStringLiteral("[urls...]"));
+
+    parser.process(app);
+    aboutData.processCommandLine(&parser);
+
+    const auto urls = parser.positionalArguments();
+
+    if (urls.isEmpty()) {
+        auto window = new %{APPNAME}Shell;
+        window->show();
+    } else {
+        for (const auto &url : urls) {
+            auto window = new %{APPNAME}Shell;
+            window->show();
+            window->loadDocument(QUrl::fromUserInput(url, QDir::currentPath(), 
QUrl::AssumeLocalFile));
+        }
+    }
+
+    return app.exec();
+}


Reply via email to