Hello community,

here is the log from the commit of package pavucontrol-qt for openSUSE:Factory 
checked in at 2017-03-13 15:32:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/pavucontrol-qt (Old)
 and      /work/SRC/openSUSE:Factory/.pavucontrol-qt.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "pavucontrol-qt"

Mon Mar 13 15:32:35 2017 rev:2 rq:460516 version:0.2.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/pavucontrol-qt/pavucontrol-qt.changes    
2016-10-06 12:42:40.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.pavucontrol-qt.new/pavucontrol-qt.changes       
2017-03-13 15:33:36.221257196 +0100
@@ -1,0 +2,14 @@
+Fri Feb 24 19:37:50 UTC 2017 - [email protected]
+
+- Update to 0.2.0:
+  * Release 0.2.0: Update changelog
+  * Use QSettings for storing configuration
+  * Create pavucontrol-qt_pt.desktop
+  * Use the new lxqt-build-tools package
+  * - Add a simple single instance controller to avoid run multiple 
simultaneous applications
+  * Use same approach as avidemux
+  * Simply differentiate the namnig to avoid menu duplication
+  * CMakeLists: Remove XdgUserDirs requirement
+  * mainwindow: Set icon for eventRoleWidget
+
+-------------------------------------------------------------------

Old:
----
  pavucontrol-qt-0.1.0.tar.xz
  pavucontrol-qt-0.1.0.tar.xz.asc

New:
----
  pavucontrol-qt-0.2.0.tar.xz
  pavucontrol-qt-0.2.0.tar.xz.asc

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

Other differences:
------------------
++++++ pavucontrol-qt.spec ++++++
--- /var/tmp/diff_new_pack.jcSv8e/_old  2017-03-13 15:33:36.737184282 +0100
+++ /var/tmp/diff_new_pack.jcSv8e/_new  2017-03-13 15:33:36.741183717 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package pavucontrol-qt
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           pavucontrol-qt
-Version:        0.1.0
+Version:        0.2.0
 Release:        0
 Summary:        Qt port of pavucontrol
 License:        GPL-2.0
@@ -27,17 +27,18 @@
 Source1:        
https://downloads.lxqt.org/%{name}/%{version}/%{name}-%{version}.tar.xz.asc
 Source2:        %{name}.keyring
 BuildRequires:  cmake >= 3.0.2
-BuildRequires:  cmake(KF5WindowSystem)
-BuildRequires:  cmake(Qt5LinguistTools)
 BuildRequires:  gcc-c++
+BuildRequires:  lxqt-build-tools-devel
 BuildRequires:  pkgconfig
+BuildRequires:  xdg-user-dirs
+BuildRequires:  cmake(KF5WindowSystem)
+BuildRequires:  cmake(Qt5LinguistTools)
 BuildRequires:  pkgconfig(Qt5DBus)
 BuildRequires:  pkgconfig(Qt5Widgets)
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(libpulse) >= 5.0
 BuildRequires:  pkgconfig(libpulse-mainloop-glib) >= 0.9.16
 BuildRequires:  pkgconfig(lxqt)
-BuildRequires:  xdg-user-dirs
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description

++++++ pavucontrol-qt-0.1.0.tar.xz -> pavucontrol-qt-0.2.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pavucontrol-qt-0.1.0/CHANGELOG 
new/pavucontrol-qt-0.2.0/CHANGELOG
--- old/pavucontrol-qt-0.1.0/CHANGELOG  2016-09-24 00:50:34.000000000 +0200
+++ new/pavucontrol-qt-0.2.0/CHANGELOG  2016-12-11 11:20:39.000000000 +0100
@@ -1,7 +1,21 @@
 
-pavucontrol-qt-0.1.0 / 2016-09-24
+pavucontrol-qt-0.2.0 / 2016-12-11
 =================================
 
+  * Release 0.2.0: Update changelog
+  * Use QSettings for storing configuration
+  * Create pavucontrol-qt_pt.desktop
+  * Use the new lxqt-build-tools package
+  * - Add a simple single instance controller to avoid run multiple 
simultaneous applications
+  * Use same approach as avidemux
+  * Simply differentiate the namnig to avoid menu duplication
+  * CMakeLists: Remove XdgUserDirs requirement
+  * mainwindow: Set icon for eventRoleWidget
+
+0.1.0 / 2016-09-24
+==================
+
+  * Release 0.1.0: Add changelog
   * devicewidget: Remove debug
   * Address compiler warnings
   * streamwidget: Fix specific termination text
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pavucontrol-qt-0.1.0/CMakeLists.txt 
new/pavucontrol-qt-0.2.0/CMakeLists.txt
--- old/pavucontrol-qt-0.1.0/CMakeLists.txt     2016-09-24 00:50:34.000000000 
+0200
+++ new/pavucontrol-qt-0.2.0/CMakeLists.txt     2016-12-11 11:20:39.000000000 
+0100
@@ -3,6 +3,7 @@
 
 option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" 
OFF)
 
+set(LXQTBT_MINIMUM_VERSION "0.1.0")
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
 
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -14,9 +15,9 @@
 
 find_package(Qt5Widgets REQUIRED QUIET)
 find_package(Qt5LinguistTools REQUIRED QUIET)
+find_package(Qt5DBus REQUIRED)
 
-find_package(lxqt REQUIRED QUIET)
-find_package(XdgUserDirs REQUIRED QUIET)
+find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED)
 
 include(LXQtCompilerSettings NO_POLICY_SCOPE)
 include(LXQtTranslate)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pavucontrol-qt-0.1.0/README.md 
new/pavucontrol-qt-0.2.0/README.md
--- old/pavucontrol-qt-0.1.0/README.md  2016-09-24 00:50:34.000000000 +0200
+++ new/pavucontrol-qt-0.2.0/README.md  2016-12-11 11:20:39.000000000 +0100
@@ -13,7 +13,7 @@
 ### Compiling source code
 
 Runtime dependencies are qtbase and PulseAudio client library libpulse.   
-Additional build dependencies are CMake, xdg-user-dirs and 
[liblxqt](https://github.com/lxde/liblxqt) as well as optionally Git to pull 
latest VCS checkouts. The localization files were outsourced to repository 
[lxqt-l10n](https://github.com/lxde/lxqt-l10n) so the corresponding 
dependencies are needed, too. Please refer to this repository's `README.md` for 
further information.   
+Additional build dependencies are CMake and 
[liblxqt](https://github.com/lxde/liblxqt) as well as optionally Git to pull 
latest VCS checkouts. The localization files were outsourced to repository 
[lxqt-l10n](https://github.com/lxde/lxqt-l10n) so the corresponding 
dependencies are needed, too. Please refer to this repository's `README.md` for 
further information.
 
 Code configuration is handled by CMake. CMake variable `CMAKE_INSTALL_PREFIX` 
has to be set to `/usr` on most operating systems.   
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pavucontrol-qt-0.1.0/src/CMakeLists.txt 
new/pavucontrol-qt-0.2.0/src/CMakeLists.txt
--- old/pavucontrol-qt-0.1.0/src/CMakeLists.txt 2016-09-24 00:50:34.000000000 
+0200
+++ new/pavucontrol-qt-0.2.0/src/CMakeLists.txt 2016-12-11 11:20:39.000000000 
+0100
@@ -35,6 +35,7 @@
     sourceoutputwidget.cc
     sourcewidget.cc
     streamwidget.cc
+    uniqueapplication.cc
 )
 
 set(pavucontrol-qt_UI
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pavucontrol-qt-0.1.0/src/mainwindow.cc 
new/pavucontrol-qt-0.2.0/src/mainwindow.cc
--- old/pavucontrol-qt-0.1.0/src/mainwindow.cc  2016-09-24 00:50:34.000000000 
+0200
+++ new/pavucontrol-qt-0.2.0/src/mainwindow.cc  2016-12-11 11:20:39.000000000 
+0100
@@ -33,6 +33,7 @@
 #include "rolewidget.h"
 #include <QIcon>
 #include <QStyle>
+#include <QSettings>
 
 /* Used for profile sorting */
 struct profile_prio_compare {
@@ -89,65 +90,30 @@
     connect(sourceTypeComboBox, 
static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, 
&MainWindow::onSourceTypeComboBoxChanged);
     connect(showVolumeMetersCheckButton, &QCheckBox::toggled, this, 
&MainWindow::onShowVolumeMetersCheckButtonToggled);
 
-    GKeyFile* config = g_key_file_new();
-    g_assert(config);
-    GKeyFileFlags flags = (GKeyFileFlags)( G_KEY_FILE_KEEP_COMMENTS | 
G_KEY_FILE_KEEP_TRANSLATIONS);
-    GError *err = nullptr;
-    m_config_filename = g_strconcat(g_get_user_config_dir(), 
"/pavucontrol.ini", nullptr);
-
-    /* Load the GKeyFile from keyfile.conf or return. */
-    if (g_key_file_load_from_file (config, m_config_filename, flags, &err)) {
-        int width  = g_key_file_get_integer(config, "window", "width", 
nullptr);
-        int height = g_key_file_get_integer(config, "window", "height", 
nullptr);
-
-        /* When upgrading from a previous version, set showVolumeMeters to TRUE
-         * (default from glade file), so users don't complain about missing
-         * volume meters. */
-        if (g_key_file_has_key(config, "window", "showVolumeMeters", nullptr)) 
{
-            
showVolumeMetersCheckButton->setChecked(g_key_file_get_boolean(config, 
"window", "showVolumeMeters", nullptr));
-        }
-
-        const QSize default_size = size(); // widget is resized in setupUi 
based on values in *.ui
-        if (width >= default_size.width() && height >= default_size.height())
-            resize(width, height);
-
-        int sinkInputTypeSelection = g_key_file_get_integer(config, "window", 
"sinkInputType", &err);
-        if (err == nullptr)
-            sinkInputTypeComboBox->setCurrentIndex(sinkInputTypeSelection);
-        else {
-            g_error_free(err);
-            err = nullptr;
-        }
-
-        int sourceOutputTypeSelection = g_key_file_get_integer(config, 
"window", "sourceOutputType", &err);
-        if (err == nullptr)
-            
sourceOutputTypeComboBox->setCurrentIndex(sourceOutputTypeSelection);
-        else {
-            g_error_free(err);
-            err = nullptr;
-        }
+    const QSettings config;
 
-        int sinkTypeSelection = g_key_file_get_integer(config, "window", 
"sinkType", &err);
-        if (err == nullptr)
-            sinkTypeComboBox->setCurrentIndex(sinkTypeSelection);
-        else {
-            g_error_free(err);
-            err = nullptr;
-        }
-
-        int sourceTypeSelection = g_key_file_get_integer(config, "window", 
"sourceType", &err);
-        if (err == nullptr)
-            sourceTypeComboBox->setCurrentIndex(sourceTypeSelection);
-        else {
-            g_error_free(err);
-            err = nullptr;
-        }
-    } else {
-        g_debug(tr("Error reading config file %s: %s").toUtf8().constData(), 
m_config_filename, err->message);
-        g_error_free(err);
-    }
-    g_key_file_free(config);
+    
showVolumeMetersCheckButton->setChecked(config.value("window/showVolumeMeters", 
true).toBool());
 
+    const QSize last_size  = config.value("window/size").toSize();
+    const QSize default_size = size(); // widget is resized in setupUi based 
on values in *.ui
+    if (last_size.width() >= default_size.width() && last_size.height() >= 
default_size.height())
+        resize(last_size);
+
+    const QVariant sinkInputTypeSelection = 
config.value("window/sinkInputType");
+    if (sinkInputTypeSelection.isValid())
+        sinkInputTypeComboBox->setCurrentIndex(sinkInputTypeSelection.toInt());
+
+    const QVariant sourceOutputTypeSelection = 
config.value("window/sourceOutputType");
+    if (sourceOutputTypeSelection.isValid())
+        
sourceOutputTypeComboBox->setCurrentIndex(sourceOutputTypeSelection.toInt());
+
+    const QVariant sinkTypeSelection = config.value("window/sinkType");
+    if (sinkTypeSelection.isValid())
+        sinkTypeComboBox->setCurrentIndex(sinkTypeSelection.toInt());
+
+    const QVariant sourceTypeSelection = config.value("window/sourceType");
+    if (sourceTypeSelection.isValid())
+        sourceTypeComboBox->setCurrentIndex(sourceTypeSelection.toInt());
 
     /* Hide first and show when we're connected */
     notebook->hide();
@@ -199,40 +165,13 @@
 #endif
 
 MainWindow::~MainWindow() {
-    GKeyFile* config = g_key_file_new();
-    g_assert(config);
-
-    g_key_file_set_integer(config, "window", "width", width());
-    g_key_file_set_integer(config, "window", "height", height());
-    g_key_file_set_integer(config, "window", "sinkInputType", 
sinkInputTypeComboBox->currentIndex());
-    g_key_file_set_integer(config, "window", "sourceOutputType", 
sourceOutputTypeComboBox->currentIndex());
-    g_key_file_set_integer(config, "window", "sinkType", 
sinkTypeComboBox->currentIndex());
-    g_key_file_set_integer(config, "window", "sourceType", 
sourceTypeComboBox->currentIndex());
-    g_key_file_set_integer(config, "window", "showVolumeMeters", 
showVolumeMetersCheckButton->isChecked());
-
-    gsize filelen;
-    GError *err = nullptr;
-    gchar *filedata = g_key_file_to_data(config, &filelen, &err);
-    if (err) {
-        show_error(tr("Error saving preferences").toUtf8().constData());
-        g_error_free(err);
-        goto finish;
-    }
-
-    g_file_set_contents(m_config_filename, filedata, filelen, &err);
-    g_free(filedata);
-    if (err) {
-        gchar* msg = g_strconcat(tr("Error writing config file 
%s").toUtf8().constData(), m_config_filename, nullptr);
-        show_error(msg);
-        g_free(msg);
-        g_error_free(err);
-        goto finish;
-    }
-
-finish:
-
-    g_key_file_free(config);
-    g_free(m_config_filename);
+    QSettings config;
+    config.setValue("window/size", size());
+    config.setValue("window/sinkInputType", 
sinkInputTypeComboBox->currentIndex());
+    config.setValue("window/sourceOutputType", 
sourceOutputTypeComboBox->currentIndex());
+    config.setValue("window/sinkType", sinkTypeComboBox->currentIndex());
+    config.setValue("window/sourceType", sourceTypeComboBox->currentIndex());
+    config.setValue("window/showVolumeMeters", 
showVolumeMetersCheckButton->isChecked());
 
     while (!clientNames.empty()) {
         std::map<uint32_t, char*>::iterator i = clientNames.begin();
@@ -857,7 +796,7 @@
     eventRoleWidget->boldNameLabel->setText("");
     eventRoleWidget->nameLabel->setText(tr("System 
Sounds").toUtf8().constData());
 
-    // 
eventRoleWidget->iconImage->set_from_icon_name("multimedia-volume-control", 
Gtk::ICON_SIZE_SMALL_TOOLBAR);
+    setIconByName(eventRoleWidget->iconImage, "multimedia-volume-control");
 
     eventRoleWidget->device = "";
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pavucontrol-qt-0.1.0/src/pavucontrol.cc 
new/pavucontrol-qt-0.2.0/src/pavucontrol.cc
--- old/pavucontrol-qt-0.1.0/src/pavucontrol.cc 2016-09-24 00:50:34.000000000 
+0200
+++ new/pavucontrol-qt-0.2.0/src/pavucontrol.cc 2016-12-11 11:20:39.000000000 
+0100
@@ -49,6 +49,8 @@
 #include <QTranslator>
 #include <QCommandLineParser>
 #include <QCommandLineOption>
+#include "uniqueapplication.h"
+#include <QString>
 
 static pa_context* context = NULL;
 static pa_mainloop_api* api = NULL;
@@ -645,7 +647,13 @@
 
     signal(SIGPIPE, SIG_IGN);
 
-    QApplication app(argc, argv);
+    UniqueApplication app(argc, argv);
+
+    if(app.active())
+        return 0;
+
+    app.setOrganizationName(QStringLiteral("pavucontrol-qt"));
+
 
     QString locale = QLocale::system().name();
     QTranslator qtTranslator;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pavucontrol-qt-0.1.0/src/translations/pavucontrol-qt_pt.desktop 
new/pavucontrol-qt-0.2.0/src/translations/pavucontrol-qt_pt.desktop
--- old/pavucontrol-qt-0.1.0/src/translations/pavucontrol-qt_pt.desktop 
1970-01-01 01:00:00.000000000 +0100
+++ new/pavucontrol-qt-0.2.0/src/translations/pavucontrol-qt_pt.desktop 
2016-12-11 11:20:39.000000000 +0100
@@ -0,0 +1,3 @@
+Name[pt]=Controlo de volume PulseAudio
+GenericName[pt]=Controlo de volume
+Comment[pt]=Ajustar o nĂ­vel do volume
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pavucontrol-qt-0.1.0/src/uniqueapplication.cc 
new/pavucontrol-qt-0.2.0/src/uniqueapplication.cc
--- old/pavucontrol-qt-0.1.0/src/uniqueapplication.cc   1970-01-01 
01:00:00.000000000 +0100
+++ new/pavucontrol-qt-0.2.0/src/uniqueapplication.cc   2016-12-11 
11:20:39.000000000 +0100
@@ -0,0 +1,48 @@
+/***
+  This file is part of pavucontrol-qt.
+
+  Copyright 2006-2008 Lennart Poettering
+  Copyright 2008 Sjoerd Simons <[email protected]>
+  Copyright 2016 Helio Chissini de Castro <[email protected]>
+
+  pavucontrol 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.
+
+  pavucontrol 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 pavucontrol. If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include "uniqueapplication.h"
+
+UniqueApplication::UniqueApplication(int &argc, char **argv)
+    : QApplication(argc, argv)
+{
+    uniq = new QSharedMemory("pavucontrol-Qt", this);
+}
+
+UniqueApplication::~UniqueApplication()
+{
+    if(uniq->isAttached())
+        uniq->detach();
+}
+
+bool UniqueApplication::active()
+{
+    if(uniq->attach(QSharedMemory::ReadOnly)){
+        uniq->detach();
+        return true;
+    }
+
+    if(uniq->create(1)){
+        return false;
+    }
+
+    return true;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pavucontrol-qt-0.1.0/src/uniqueapplication.h 
new/pavucontrol-qt-0.2.0/src/uniqueapplication.h
--- old/pavucontrol-qt-0.1.0/src/uniqueapplication.h    1970-01-01 
01:00:00.000000000 +0100
+++ new/pavucontrol-qt-0.2.0/src/uniqueapplication.h    2016-12-11 
11:20:39.000000000 +0100
@@ -0,0 +1,42 @@
+/***
+  This file is part of pavucontrol-qt.
+
+  Copyright 2006-2008 Lennart Poettering
+  Copyright 2008 Sjoerd Simons <[email protected]>
+  Copyright 2016 Helio Chissini de Castro <[email protected]>
+
+  pavucontrol 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.
+
+  pavucontrol 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 pavucontrol. If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#ifndef UNIQUEAPPLICATION_H
+#define UNIQUEAPPLICATION_H
+
+#include <QApplication>
+#include <QSharedMemory>
+
+class UniqueApplication : public QApplication
+{
+    Q_OBJECT
+
+public:
+    UniqueApplication(int &argc, char** argv);
+    ~UniqueApplication();
+
+    bool active();
+
+private:
+    QSharedMemory *uniq;
+};
+
+#endif // UNIQUEAPPLICATION_H



Reply via email to