commit orion for openSUSE:Factory
Hello community,
here is the log from the commit of package orion for openSUSE:Factory checked in at 2017-05-31 12:18:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/orion (Old)
and /work/SRC/openSUSE:Factory/.orion.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "orion"
Wed May 31 12:18:11 2017 rev:5 rq:498619 version:1.5.1+git~20170519
Changes:
--------
--- /work/SRC/openSUSE:Factory/orion/orion.changes 2017-05-20 10:14:34.376171570 +0200
+++ /work/SRC/openSUSE:Factory/.orion.new/orion.changes 2017-05-31 12:19:23.295398204 +0200
@@ -1,0 +2,6 @@
+Sat May 20 12:07:13 UTC 2017 - pousaduarte@gmail.com
+
+- Update to version 1.5.1+git~20170519:
+ * ChannelListModel improvements (#162)
+
+-------------------------------------------------------------------
Old:
----
orion-1.5.1+git~20170518.tar.xz
New:
----
orion-1.5.1+git~20170519.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ orion.spec ++++++
--- /var/tmp/diff_new_pack.z6J8Lz/_old 2017-05-31 12:19:25.379104060 +0200
+++ /var/tmp/diff_new_pack.z6J8Lz/_new 2017-05-31 12:19:25.379104060 +0200
@@ -17,7 +17,7 @@
Name: orion
-Version: 1.5.1+git~20170518
+Version: 1.5.1+git~20170519
Release: 0
Summary: Twitch stream client using Qt
License: GPL-3.0
++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.z6J8Lz/_old 2017-05-31 12:19:25.431096720 +0200
+++ /var/tmp/diff_new_pack.z6J8Lz/_new 2017-05-31 12:19:25.435096156 +0200
@@ -1,4 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/alamminsalo/orion.git</param>
- <param name="changesrevision">f16fb3a246e777eb162dd66cff453959d606d905</param></service></servicedata>
\ No newline at end of file
+ <param name="changesrevision">0f79a6bb5132c97ba1602b59596eeb669a4977f0</param></service></servicedata>
\ No newline at end of file
++++++ orion-1.5.1+git~20170518.tar.xz -> orion-1.5.1+git~20170519.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orion-1.5.1+git~20170518/src/model/channel.cpp new/orion-1.5.1+git~20170519/src/model/channel.cpp
--- old/orion-1.5.1+git~20170518/src/model/channel.cpp 2017-05-18 07:55:24.000000000 +0200
+++ new/orion-1.5.1+git~20170519/src/model/channel.cpp 2017-05-19 14:24:40.000000000 +0200
@@ -146,7 +146,7 @@
timestamp = QDateTime::currentDateTime().toMSecsSinceEpoch();
}
-qint64 Channel::getTime(){
+qint64 Channel::getTime() const{
return timestamp;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orion-1.5.1+git~20170518/src/model/channel.h new/orion-1.5.1+git~20170519/src/model/channel.h
--- old/orion-1.5.1+git~20170518/src/model/channel.h 2017-05-18 07:55:24.000000000 +0200
+++ new/orion-1.5.1+git~20170519/src/model/channel.h 2017-05-19 14:24:40.000000000 +0200
@@ -57,7 +57,7 @@
void setLastSeen(time_t);
const QString lastOnline();
void updateTime();
- qint64 getTime();
+ qint64 getTime() const;
const QString getName() const;
const QString getServiceName() const;
const QString getFullUri() const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orion-1.5.1+git~20170518/src/model/channellistmodel.cpp new/orion-1.5.1+git~20170519/src/model/channellistmodel.cpp
--- old/orion-1.5.1+git~20170518/src/model/channellistmodel.cpp 2017-05-18 07:55:24.000000000 +0200
+++ new/orion-1.5.1+git~20170519/src/model/channellistmodel.cpp 2017-05-19 14:24:40.000000000 +0200
@@ -94,23 +94,84 @@
return channels.size();
}
+void debugChannel(const QString prefix, const Channel * c) {
+ qDebug() << prefix << ":" << c->getId() << c->getName() << "game" << c->getGame() << "serviceName" << c->getServiceName() << "time" << c->getTime() << "viewers" << c->getViewers();
+}
+
+void ChannelListModel::addChannelInternal(Channel *channel) {
+ channels.append(channel);
+ auto id = channel->getId();
+ if (id == 0) {
+ qDebug() << "inserting new channel with 0 id";
+ }
+ else {
+ channelIdIndex.insert(id, channel);
+ }
+}
+
void ChannelListModel::addChannel(Channel *channel)
{
- beginInsertRows(QModelIndex(), channels.size(), channels.size());
- channels.append(channel);
- endInsertRows();
+ if (updateChannelIfExisting(channel)) {
+ qDebug() << "ChannelListModel::addChannel got existing channel" << channel->getId() << channel->getName();
+ }
+ else {
+ beginInsertRows(QModelIndex(), channels.size(), channels.size());
+ addChannelInternal(channel);
+ endInsertRows();
+ }
+}
+
+bool ChannelListModel::updateChannelIfExisting(const Channel * channel) {
+ const auto id = channel->getId();
+
+ const auto existingChannelEntry = channelIdIndex.find(id);
+ if (existingChannelEntry != channelIdIndex.end()) {
+ Channel * existingChannel = existingChannelEntry.value();
+ debugChannel("existingChannel", existingChannel);
+ debugChannel("addedChannel", channel);
+
+ if (channel->getTime() < existingChannel->getTime()) {
+ qDebug() << "added item was older; skipping update";
+ }
+ else {
+ existingChannel->updateWith(*channel);
+ updateChannelForView(existingChannel);
+ }
+ return true;
+ }
+ else {
+ return false;
+ }
+
}
-void ChannelListModel::addAll(const QList
participants (1)
-
root@hilbert.suse.de