[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498
Maximiliano Curia
maxy at moszumanska.debian.org
Fri Oct 14 14:28:13 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=da1cb4c
The following commit has been merged in the master branch:
commit da1cb4c354e0c5f4f1b75079f82c0461413c176d
Author: Albert Vaca <albertvaka at gmail.com>
Date: Tue Jan 20 22:22:14 2015 -0800
Coding style
---
core/filetransferjob.cpp | 37 +++++++++++-----------
core/filetransferjob.h | 7 ++--
interfaces/devicesmodel.h | 6 ++--
interfaces/notificationsmodel.cpp | 8 ++---
interfaces/notificationsmodel.h | 14 ++++----
.../kdeconnectdeclarativeplugin.h | 9 ++----
plugins/notifications/notification.cpp | 1 +
7 files changed, 39 insertions(+), 43 deletions(-)
diff --git a/core/filetransferjob.cpp b/core/filetransferjob.cpp
index 2dad5de..070048c 100644
--- a/core/filetransferjob.cpp
+++ b/core/filetransferjob.cpp
@@ -28,18 +28,17 @@
#include "kdebugnamespace.h"
-FileTransferJob::FileTransferJob(const QSharedPointer<QIODevice>& origin, qint64 size, const KUrl& destination): KJob()
+FileTransferJob::FileTransferJob(const QSharedPointer<QIODevice>& origin, qint64 size, const KUrl& destination)
+ : KJob()
+ , mOrigin(origin)
+ , mDestinationJob(0)
+ , mDeviceName("KDE Connect")
+ , mDestination(destination)
+ , mSpeedBytes(0)
+ , mSize(size)
+ , mWritten(0)
{
Q_ASSERT(destination.isLocalFile());
- //TODO: Make a precondition before calling this function that destination file exists
- mOrigin = origin;
- mSize = size;
- mWritten = 0;
- m_speedBytes = 0;
- mDestination = destination;
- mDestinationJob = 0;
- mDeviceName = i18nc("Device name that will appear on the jobs", "KDE-Connect");
-
setCapabilities(Killable);
kDebug(debugArea()) << "FileTransferJob Downloading payload to" << destination;
}
@@ -117,14 +116,14 @@ void FileTransferJob::startTransfer()
{
setTotalAmount(Bytes, mSize);
setProcessedAmount(Bytes, 0);
- m_time = QTime::currentTime();
+ mTime = QTime::currentTime();
description(this, i18n("Receiving file over KDE-Connect"),
QPair<QString, QString>(i18nc("File transfer origin", "From"),
QString(mDeviceName)),
QPair<QString, QString>(i18nc("File transfer destination", "To"), mDestination.path()));
- QFile(mDestination.path()).open(QIODevice::WriteOnly | QIODevice::Truncate); //HACK: KIO is so dumb it can't create the file if it doesn't exist
mDestinationJob = KIO::open(mDestination, QIODevice::WriteOnly);
+ QFile(mDestination.path()).open(QIODevice::WriteOnly | QIODevice::Truncate); //KIO won't create the file if it doesn't exist
connect(mDestinationJob, SIGNAL(open(KIO::Job*)), this, SLOT(open(KIO::Job*)));
connect(mDestinationJob, SIGNAL(result(KJob*)), this, SLOT(openFinished(KJob*)));
@@ -165,15 +164,15 @@ void FileTransferJob::readyRead()
if (mSize > -1) {
//If a least 1 second has passed since last update
- int secondsSinceLastTime = m_time.secsTo(QTime::currentTime());
- if (secondsSinceLastTime > 0 && m_speedBytes > 0) {
- float speed = (mWritten - m_speedBytes) / secondsSinceLastTime;
+ int secondsSinceLastTime = mTime.secsTo(QTime::currentTime());
+ if (secondsSinceLastTime > 0 && mSpeedBytes > 0) {
+ float speed = (mWritten - mSpeedBytes) / secondsSinceLastTime;
emitSpeed(speed);
- m_time = QTime::currentTime();
- m_speedBytes = mWritten;
- } else if(m_speedBytes == 0) {
- m_speedBytes = mWritten;
+ mTime = QTime::currentTime();
+ mSpeedBytes = mWritten;
+ } else if(mSpeedBytes == 0) {
+ mSpeedBytes = mWritten;
}
}
diff --git a/core/filetransferjob.h b/core/filetransferjob.h
index b022210..30ab4c2 100644
--- a/core/filetransferjob.h
+++ b/core/filetransferjob.h
@@ -40,7 +40,7 @@ public:
FileTransferJob(const QSharedPointer<QIODevice>& origin, qint64 size, const KUrl& destination);
virtual void start();
KUrl destination() const { return mDestination; }
- void setDeviceName(const QString &deviceName) {mDeviceName = deviceName;};
+ void setDeviceName(const QString &deviceName) { mDeviceName = deviceName; }
public Q_SLOTS:
void doStart();
@@ -59,11 +59,10 @@ private:
KIO::FileJob* mDestinationJob;
QString mDeviceName;
KUrl mDestination;
- QTime m_time;
- qulonglong m_speedBytes;
+ QTime mTime;
+ qulonglong mSpeedBytes;
qint64 mSize;
qint64 mWritten;
-
};
#endif
diff --git a/interfaces/devicesmodel.h b/interfaces/devicesmodel.h
index 75ee0c1..283711e 100644
--- a/interfaces/devicesmodel.h
+++ b/interfaces/devicesmodel.h
@@ -40,10 +40,10 @@ class KDECONNECTINTERFACES_EXPORT DevicesModel
public:
enum ModelRoles {
- NameModelRole = Qt::DisplayRole,
- IconModelRole = Qt::DecorationRole,
+ NameModelRole = Qt::DisplayRole,
+ IconModelRole = Qt::DecorationRole,
StatusModelRole = Qt::InitialSortOrderRole,
- IdModelRole = Qt::UserRole,
+ IdModelRole = Qt::UserRole,
IconNameRole
};
enum StatusFlag {
diff --git a/interfaces/notificationsmodel.cpp b/interfaces/notificationsmodel.cpp
index a3d7ca2..4f6feb4 100644
--- a/interfaces/notificationsmodel.cpp
+++ b/interfaces/notificationsmodel.cpp
@@ -48,9 +48,9 @@ NotificationsModel::NotificationsModel(QObject* parent)
//Role names for QML
QHash<int, QByteArray> names = roleNames();
- names.insert(DbusInterfaceRole, "dbusInterface");
- names.insert(AppNameModelRole, "appName");
- names.insert(IdModelRole, "notificationId");
+ names.insert(DbusInterfaceRole, "dbusInterface");
+ names.insert(AppNameModelRole, "appName");
+ names.insert(IdModelRole, "notificationId");
names.insert(DismissableModelRole, "dismissable");
setRoleNames(names);
@@ -155,7 +155,7 @@ QVariant NotificationsModel::data(const QModelIndex& index, int role) const
NotificationDbusInterface* notification = m_notificationList[index.row()];
- //FIXME: This function gets called lots of times, producing lots of dbus calls. Add a cache.
+ //FIXME: This function gets called lots of times, producing lots of dbus calls. Add a cache?
switch (role) {
case IconModelRole:
return KIcon("device-notifier").pixmap(32, 32);
diff --git a/interfaces/notificationsmodel.h b/interfaces/notificationsmodel.h
index f9a7479..6825fa6 100644
--- a/interfaces/notificationsmodel.h
+++ b/interfaces/notificationsmodel.h
@@ -38,13 +38,13 @@ class KDECONNECTINTERFACES_EXPORT NotificationsModel
public:
enum ModelRoles {
- IconModelRole = Qt::DecorationRole,
- NameModelRole = Qt::DisplayRole,
- ContentModelRole = Qt::UserRole,
- AppNameModelRole = Qt::UserRole + 1,
- IdModelRole = Qt::UserRole + 2,
- DismissableModelRole = Qt::UserRole + 3,
- DbusInterfaceRole = Qt::UserRole + 4
+ IconModelRole = Qt::DecorationRole,
+ NameModelRole = Qt::DisplayRole,
+ ContentModelRole = Qt::UserRole,
+ AppNameModelRole = Qt::UserRole + 1,
+ IdModelRole,
+ DismissableModelRole,
+ DbusInterfaceRole,
};
NotificationsModel(QObject* parent = 0);
diff --git a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h
index 6324b7a..a976d19 100644
--- a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h
+++ b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h
@@ -18,8 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef ANALITZADECLARATIVEPLUGIN_H
-#define ANALITZADECLARATIVEPLUGIN_H
+#ifndef KDECONNECTDECLARATIVEPLUGIN_H
+#define KDECONNECTDECLARATIVEPLUGIN_H
#include <QDeclarativeExtensionPlugin>
@@ -30,7 +30,4 @@ class KdeConnectDeclarativePlugin : public QDeclarativeExtensionPlugin
};
-
-
-
-#endif // ANALITZADECLARATIVEPLUGIN_H
+#endif
diff --git a/plugins/notifications/notification.cpp b/plugins/notifications/notification.cpp
index 3c15d47..319d267 100644
--- a/plugins/notifications/notification.cpp
+++ b/plugins/notifications/notification.cpp
@@ -45,3 +45,4 @@ void Notification::dismiss()
Q_EMIT dismissRequested(this);
}
}
+
--
kdeconnect packaging
More information about the pkg-kde-commits
mailing list