[SCM] ktp-filetransfer-handler packaging branch, master, updated. debian/15.12.1-2-226-g825cd93

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:12:54 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-filetransfer-handler.git;a=commitdiff;h=a021abc

The following commit has been merged in the master branch:
commit a021abc0defbd0436946a680c77403fbfa36149f
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Sun Oct 26 01:37:19 2014 +0200

    Initial port to KF5
    
    REVIEW: 120804
---
 CMakeLists.txt                                    | 35 ++++++++------------
 cmake/modules/COPYING-CMAKE-SCRIPTS               | 22 -------------
 cmake/modules/FindKTp.cmake                       | 38 ----------------------
 src/CMakeLists.txt                                | 11 +++----
 src/handle-incoming-file-transfer-channel-job.cpp | 39 +++++++++++------------
 src/handle-outgoing-file-transfer-channel-job.cpp |  3 +-
 src/main.cpp                                      |  8 ++---
 src/telepathy-base-job.cpp                        |  2 +-
 8 files changed, 43 insertions(+), 115 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5664e52..7dabd67 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,29 +1,22 @@
 project (ktp-filetransfer-handler)
 
-set(KTP_FILETRANSFER_HANDLER_VERSION "0.8.80")
-
-set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})
-cmake_policy(SET CMP0002 OLD)
-
-set(IS_KTP_INTERNAL_MODULE TRUE)
-set(KDE_MIN_VERSION "4.6.0")
+cmake_minimum_required(VERSION 2.8.12)
 
-find_package(KDE4 ${KDE_MIN_VERSION} REQUIRED)
-find_package(TelepathyQt4 0.9.1 REQUIRED)
-find_package(KTp REQUIRED)
+set(KTP_FILETRANSFER_HANDLER_VERSION "0.8.80")
 
-include(CheckIncludeFiles)
-include(KDE4Defaults)
-include(MacroLibrary)
+find_package(ECM 1.3.0 REQUIRED NO_MODULE)
+set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_MODULE_PATH})
 
-add_definitions(${KDE4_DEFINITIONS}
-                -DQT_NO_CAST_FROM_ASCII
-                -DQT_NO_KEYWORDS
-)
+find_package (KF5 REQUIRED COMPONENTS KDELibs4Support)
+find_package (Qt5 REQUIRED COMPONENTS Core)
+find_package (KTp REQUIRED)
 
-include_directories(${KDE4_INCLUDES}
-                    ${TELEPATHY_QT4_INCLUDE_DIR}
-                    ${KTP_INCLUDE_DIR}
-)
+include(KDEInstallDirs)
+include(KDECMakeSettings)
+include(KDECompilerSettings)
+include(ECMSetupVersion)
+include(FeatureSummary)
 
 add_subdirectory(src)
+
+feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/cmake/modules/COPYING-CMAKE-SCRIPTS b/cmake/modules/COPYING-CMAKE-SCRIPTS
deleted file mode 100644
index 4b41776..0000000
--- a/cmake/modules/COPYING-CMAKE-SCRIPTS
+++ /dev/null
@@ -1,22 +0,0 @@
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the copyright
-   notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-3. The name of the author may not be used to endorse or promote products 
-   derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/cmake/modules/FindKTp.cmake b/cmake/modules/FindKTp.cmake
deleted file mode 100644
index 8facd12..0000000
--- a/cmake/modules/FindKTp.cmake
+++ /dev/null
@@ -1,38 +0,0 @@
-# Try to find the KTp library
-# KTP_FOUND
-# KTP_INCLUDE_DIR
-# KTP_LIBRARIES
-# KTP_MODELS_LIBRARIES
-# KTP_WIDGETS_LIBRARIES
-
-# Copyright (c) 2011, Dario Freddi <drf at kde.org>
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-
-if (NOT IS_KTP_INTERNAL_MODULE)
-   message (FATAL_ERROR "KTp can be used just from internal components at this time")
-endif (NOT IS_KTP_INTERNAL_MODULE)
-
-SET (KTP_FIND_REQUIRED ${KTp_FIND_REQUIRED})
-if (KTP_INCLUDE_DIRS AND KTP_LIBRARIES)
-  # Already in cache, be silent
-  set(KTP_FIND_QUIETLY TRUE)
-endif (KTP_INCLUDE_DIRS AND KTP_LIBRARIES)
-
-find_path(KTP_INCLUDE_DIR
-  NAMES KTp/presence.h
-  PATHS ${KDE4_INCLUDE_DIR}
-)
-
-find_library(KTP_LIBRARIES NAMES ktpcommoninternalsprivate )
-find_library(KTP_MODELS_LIBRARIES NAMES ktpmodelsprivate )
-find_library(KTP_WIDGETS_LIBRARIES NAMES ktpwidgetsprivate )
-
-include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(KTp DEFAULT_MSG
-                                  KTP_LIBRARIES
-                                  KTP_MODELS_LIBRARIES
-                                  KTP_INCLUDE_DIR)
-
-mark_as_advanced(KTP_INCLUDE_DIRS KTP_LIBRARIES)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ebd892c..e2c5e3d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,3 +1,5 @@
+include_directories(${CMAKE_BINARY_DIR})
+
 set(ktp_filetransfer_handler_SRCS
     main.cpp
     filetransfer-handler.cpp
@@ -8,14 +10,11 @@ set(ktp_filetransfer_handler_SRCS
 
 configure_file(version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
 
-kde4_add_executable(ktp-filetransfer-handler ${ktp_filetransfer_handler_SRCS})
+add_executable(ktp-filetransfer-handler ${ktp_filetransfer_handler_SRCS})
 
 target_link_libraries(ktp-filetransfer-handler
-            ${KDE4_KDECORE_LIBS}
-            ${KDE4_KDEUI_LIBS}
-            ${KDE4_KIO_LIBS}
-            ${TELEPATHY_QT4_LIBRARIES}
-            ${KTP_LIBRARIES}
+            KTp::CommonInternals
+            KF5::KDELibs4Support
 )
 
 configure_file(org.freedesktop.Telepathy.Client.KTp.FileTransferHandler.service.in
diff --git a/src/handle-incoming-file-transfer-channel-job.cpp b/src/handle-incoming-file-transfer-channel-job.cpp
index 36b8310..efdd052 100644
--- a/src/handle-incoming-file-transfer-channel-job.cpp
+++ b/src/handle-incoming-file-transfer-channel-job.cpp
@@ -49,7 +49,7 @@ public:
     QString downloadDirectory;
     bool askForDownloadDirectory;
     QFile* file;
-    KUrl url, partUrl;
+    QUrl url, partUrl;
     qulonglong offset;
     bool isResuming;
     QWeakPointer<KIO::RenameDialog> renameDialog;
@@ -177,8 +177,8 @@ void HandleIncomingFileTransferChannelJobPrivate::start()
     if (askForDownloadDirectory) {
         url = KFileDialog::getSaveUrl(KUrl(QLatin1String("kfiledialog:///FileTransferLastDirectory/") + channel->fileName()),
                                       QString(), 0, QString(), KFileDialog::ConfirmOverwrite);
-        partUrl = url.directory();
-        partUrl.addPath(url.fileName() + QLatin1String(".part"));
+
+        partUrl.setPath(url.path() + QLatin1String(".part"));
         partUrl.setScheme(QLatin1String("file"));
 
         checkPartFile();
@@ -192,27 +192,25 @@ void HandleIncomingFileTransferChannelJobPrivate::checkFileExists()
 {
     Q_Q(HandleIncomingFileTransferChannelJob);
 
-    url = downloadDirectory;
-    url.addPath(channel->fileName());
+    url = downloadDirectory + QLatin1Char('/') + channel->fileName();
     url.setScheme(QLatin1String("file"));
 
-    partUrl = url.directory();
-    partUrl.addPath(url.fileName() + QLatin1String(".part"));
+    partUrl = url.path() + QLatin1String(".part");
     partUrl.setScheme(QLatin1String("file"));
 
     QFileInfo fileInfo(url.toLocalFile()); // TODO check if it is a dir?
     if (fileInfo.exists()) {
         renameDialog = new KIO::RenameDialog(0,
                                              i18n("Incoming file exists"),
-                                             KUrl(), //TODO
+                                             QUrl(), //TODO
                                              url,
-                                             KIO::M_OVERWRITE,
+                                             KIO::RenameDialog_Overwrite,
                                              fileInfo.size(),
                                              channel->size(),
-                                             fileInfo.created().toTime_t(),
-                                             time_t(-1),
-                                             fileInfo.lastModified().toTime_t(),
-                                             channel->lastModificationTime().toTime_t());
+                                             fileInfo.created(),
+                                             QDateTime(),
+                                             fileInfo.lastModified(),
+                                             channel->lastModificationTime());
 
         q->connect(q, SIGNAL(finished(KJob*)),
                    renameDialog.data(), SLOT(reject()));
@@ -281,15 +279,15 @@ void HandleIncomingFileTransferChannelJobPrivate::checkPartFile()
     if (fileInfo.exists()) {
         renameDialog = new KIO::RenameDialog(0,
                                              i18n("Would you like to resume partial download?"),
-                                             KUrl(), //TODO
+                                             QUrl(),
                                              partUrl,
-                                             KIO::RenameDialog_Mode(KIO::M_RESUME),
+                                             KIO::RenameDialog_Resume,
                                              fileInfo.size(),
                                              channel->size(),
-                                             fileInfo.created().toTime_t(),
-                                             time_t(-1),
-                                             fileInfo.lastModified().toTime_t(),
-                                             channel->lastModificationTime().toTime_t());
+                                             fileInfo.created(),
+                                             QDateTime(),
+                                             fileInfo.lastModified(),
+                                             channel->lastModificationTime());
 
         q->connect(q, SIGNAL(finished(KJob*)),
                    renameDialog.data(), SLOT(reject()));
@@ -528,5 +526,4 @@ void HandleIncomingFileTransferChannelJobPrivate::__k__onInvalidated()
     QTimer::singleShot(0, q, SLOT(__k__doEmitResult()));
 }
 
-
-#include "handle-incoming-file-transfer-channel-job.moc"
+#include "moc_handle-incoming-file-transfer-channel-job.cpp"
diff --git a/src/handle-outgoing-file-transfer-channel-job.cpp b/src/handle-outgoing-file-transfer-channel-job.cpp
index 762bd12..af9b679 100644
--- a/src/handle-outgoing-file-transfer-channel-job.cpp
+++ b/src/handle-outgoing-file-transfer-channel-job.cpp
@@ -310,5 +310,4 @@ void HandleOutgoingFileTransferChannelJobPrivate::__k__onInvalidated()
     QTimer::singleShot(0, q, SLOT(__k__doEmitResult()));
 }
 
-
-#include "handle-outgoing-file-transfer-channel-job.moc"
+#include "moc_handle-outgoing-file-transfer-channel-job.cpp"
diff --git a/src/main.cpp b/src/main.cpp
index 5382122..03d50f0 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -20,7 +20,7 @@
 
 #include <KTp/telepathy-handler-application.h>
 
-#include <KAboutData>
+#include <K4AboutData>
 #include <KCmdLineArgs>
 #include <KDebug>
 #include <TelepathyQt/ClientRegistrar>
@@ -29,12 +29,12 @@
 
 int main(int argc, char* argv[])
 {
-    KAboutData aboutData("ktp-filetransfer-handler",
+    K4AboutData aboutData("ktp-filetransfer-handler",
                          "ktp-filetransfer-handler",
                          ki18n("Telepathy File Transfer Handler"),
                          KTP_FILETRANSFER_HANDLER_VERSION,
                          ki18n("Handles your Telepathy file transfers"),
-                         KAboutData::License_GPL_V2,
+                         K4AboutData::License_GPL_V2,
                          ki18n("Copyright (C) 2010, 2011, 2012 Daniele E. Domenichelli <daniele.domenichelli at gmail.com>"));
     aboutData.addAuthor(ki18n("Daniele E. Domenichelli"),
                         ki18n("Developer"),
@@ -57,7 +57,7 @@ int main(int argc, char* argv[])
     aboutData.setHomepage("http://community.kde.org/KTp");
 
     KCmdLineArgs::init(argc, argv, &aboutData);
-    KTp::TelepathyHandlerApplication app;
+    KTp::TelepathyHandlerApplication app(argc, argv);
 
     Tp::AccountFactoryPtr accountFactory = Tp::AccountFactory::create(QDBusConnection::sessionBus());
 
diff --git a/src/telepathy-base-job.cpp b/src/telepathy-base-job.cpp
index 3dab71e..f1ac0e6 100644
--- a/src/telepathy-base-job.cpp
+++ b/src/telepathy-base-job.cpp
@@ -136,4 +136,4 @@ void TelepathyBaseJobPrivate::__k__doEmitResult()
     q->emitResult();
 }
 
-#include "telepathy-base-job.moc"
+#include "moc_telepathy-base-job.cpp"

-- 
ktp-filetransfer-handler packaging



More information about the pkg-kde-commits mailing list