diff options
author | Andrej Shadura <andrew.shadura@collabora.co.uk> | 2021-01-06 16:06:34 +0100 |
---|---|---|
committer | Andrej Shadura <andrew.shadura@collabora.co.uk> | 2021-01-06 16:06:34 +0100 |
commit | bdbef640231de79c88d5ad90528d4a7bb4cb2bf4 (patch) | |
tree | 27833d2b9e274cbe8ff8054648161ea563a4710c | |
parent | 532e58d8f7902f6899f4824ffb1560d850fbe619 (diff) | |
parent | 0d865ccf8d786857da1a1e92b24e196cbdc7afb8 (diff) |
Update upstream source from tag 'upstream/4.0.5'
Update to upstream version '4.0.5'
with Debian dir 7f61c66ca912ab0617ddf32434590359edbb2a75
-rw-r--r-- | acinclude.m4 | 1 | ||||
-rw-r--r-- | config.h.in | 3 | ||||
-rwxr-xr-x | configure | 21 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rwxr-xr-x | mkrelease.sh | 2 | ||||
-rw-r--r-- | src/libaudqt/audqt.cc | 2 | ||||
-rw-r--r-- | src/libaudqt/fileopener.cc | 4 | ||||
-rw-r--r-- | src/libaudqt/font-entry.cc | 2 | ||||
-rw-r--r-- | src/libaudqt/info-widget.cc | 5 | ||||
-rw-r--r-- | src/libaudqt/libaudqt-internal.h | 3 | ||||
-rw-r--r-- | src/libaudqt/log-inspector.cc | 3 | ||||
-rw-r--r-- | src/libaudqt/prefs-plugin.cc | 22 | ||||
-rw-r--r-- | src/libaudqt/queue-manager-qt.cc | 6 | ||||
-rw-r--r-- | src/libaudtag/ape/ape.cc | 39 |
14 files changed, 71 insertions, 44 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 5e25b37..5f4fba2 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -220,6 +220,7 @@ if test $USE_QT = yes ; then PKG_CHECK_VAR([QTBINPATH], [Qt5Core >= 5.2], [host_bins]) PKG_CHECK_MODULES([QT], [Qt5Core Qt5Gui Qt5Widgets >= 5.2]) AC_DEFINE([USE_QT], [1], [Define if Qt support enabled]) + AC_DEFINE([QT_NO_DEPRECATED_WARNINGS], [1], [Qt 6 is not supported yet]) # needed if Qt was built with -reduce-relocations QTCORE_CFLAGS="$QTCORE_CFLAGS -fPIC" diff --git a/config.h.in b/config.h.in index a13f35b..2221e6a 100644 --- a/config.h.in +++ b/config.h.in @@ -94,6 +94,9 @@ /* Suffix for plugins */ #undef PLUGIN_SUFFIX +/* Qt 6 is not supported yet */ +#undef QT_NO_DEPRECATED_WARNINGS + /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for audacious 4.0.4. +# Generated by GNU Autoconf 2.69 for audacious 4.0.5. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -579,8 +579,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='audacious' PACKAGE_TARNAME='audacious' -PACKAGE_VERSION='4.0.4' -PACKAGE_STRING='audacious 4.0.4' +PACKAGE_VERSION='4.0.5' +PACKAGE_STRING='audacious 4.0.5' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1369,7 +1369,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures audacious 4.0.4 to adapt to many kinds of systems. +\`configure' configures audacious 4.0.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1435,7 +1435,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of audacious 4.0.4:";; + short | recursive ) echo "Configuration of audacious 4.0.5:";; esac cat <<\_ACEOF @@ -1568,7 +1568,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -audacious configure 4.0.4 +audacious configure 4.0.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2036,7 +2036,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by audacious $as_me 4.0.4, which was +It was created by audacious $as_me 4.0.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -6914,6 +6914,9 @@ fi $as_echo "#define USE_QT 1" >>confdefs.h +$as_echo "#define QT_NO_DEPRECATED_WARNINGS 1" >>confdefs.h + + # needed if Qt was built with -reduce-relocations QTCORE_CFLAGS="$QTCORE_CFLAGS -fPIC" QT_CFLAGS="$QT_CFLAGS -fPIC" @@ -10952,7 +10955,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by audacious $as_me 4.0.4, which was +This file was extended by audacious $as_me 4.0.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -11018,7 +11021,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -audacious config.status 4.0.4 +audacious config.status 4.0.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 20065d3..5e09b28 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ dnl Initialize dnl ========== AC_PREREQ([2.59]) -AC_INIT([audacious], [4.0.4]) +AC_INIT([audacious], [4.0.5]) AC_COPYRIGHT([Copyright (C) 2001-2020 Audacious developers and others]) AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE_NAME", [Name of package]) diff --git a/mkrelease.sh b/mkrelease.sh index 5e08c1a..4b3a556 100755 --- a/mkrelease.sh +++ b/mkrelease.sh @@ -1,6 +1,6 @@ #!/bin/sh -if ! test -d .git +if ! test -e .git then echo This script must be run in a Git repository exit 1 diff --git a/src/libaudqt/audqt.cc b/src/libaudqt/audqt.cc index c81eb20..a5d3e95 100644 --- a/src/libaudqt/audqt.cc +++ b/src/libaudqt/audqt.cc @@ -105,6 +105,7 @@ EXPORT void cleanup() infopopup_hide_now(); infowin_hide(); log_inspector_hide(); + plugin_prefs_hide(); prefswin_hide(); queue_manager_hide(); @@ -228,6 +229,7 @@ EXPORT void simple_message(const char * title, const char * text, auto msgbox = new QMessageBox(icon, title, text, QMessageBox::Close); msgbox->button(QMessageBox::Close)->setText(translate_str(N_("_Close"))); msgbox->setAttribute(Qt::WA_DeleteOnClose); + msgbox->setTextInteractionFlags(Qt::TextSelectableByMouse); msgbox->show(); } diff --git a/src/libaudqt/fileopener.cc b/src/libaudqt/fileopener.cc index d1af3df..de2173e 100644 --- a/src/libaudqt/fileopener.cc +++ b/src/libaudqt/fileopener.cc @@ -78,7 +78,7 @@ EXPORT void fileopener_show(FileMode mode) if (mode == FileMode::ExportPlaylist) dialog->setAcceptMode(QFileDialog::AcceptSave); - QObject::connect(dialog, &QFileDialog::directoryEntered, + QObject::connect(dialog.data(), &QFileDialog::directoryEntered, [](const QString & path) { aud_set_str("audgui", "filesel_path", path.toUtf8().constData()); @@ -87,7 +87,7 @@ EXPORT void fileopener_show(FileMode mode) auto playlist = Playlist::active_playlist(); QObject::connect( - dialog, &QFileDialog::accepted, [dialog, mode, playlist]() { + dialog.data(), &QFileDialog::accepted, [dialog, mode, playlist]() { Index<PlaylistAddItem> files; for (const QUrl & url : dialog->selectedUrls()) files.append(String(url.toEncoded().constData())); diff --git a/src/libaudqt/font-entry.cc b/src/libaudqt/font-entry.cc index 95b4ff5..ff5b698 100644 --- a/src/libaudqt/font-entry.cc +++ b/src/libaudqt/font-entry.cc @@ -148,7 +148,7 @@ void FontEntry::show_dialog() { m_dialog = new QFontDialog(this); - QObject::connect(m_dialog, &QFontDialog::fontSelected, + QObject::connect(m_dialog.data(), &QFontDialog::fontSelected, [this](const QFont & font) { setText((const char *)qfont_to_string(font)); end(false); diff --git a/src/libaudqt/info-widget.cc b/src/libaudqt/info-widget.cc index 0baa2fd..b5c7408 100644 --- a/src/libaudqt/info-widget.cc +++ b/src/libaudqt/info-widget.cc @@ -162,10 +162,11 @@ public: InfoModel(QObject * parent = nullptr) : QAbstractTableModel(parent) {} - int rowCount(const QModelIndex &) const override + int rowCount(const QModelIndex & parent) const override { - return aud::n_elems(tuple_field_map); + return parent.isValid() ? 0 : aud::n_elems(tuple_field_map); } + int columnCount(const QModelIndex &) const override { return 2; } QVariant data(const QModelIndex & index, int role) const override; diff --git a/src/libaudqt/libaudqt-internal.h b/src/libaudqt/libaudqt-internal.h index 3dd1398..3d67a45 100644 --- a/src/libaudqt/libaudqt-internal.h +++ b/src/libaudqt/libaudqt-internal.h @@ -36,6 +36,9 @@ void infopopup_hide_now(); void log_init(); void log_cleanup(); +/* prefs-plugin.cc */ +void plugin_prefs_hide(); + /* util-qt.cc */ class PopupWidget : public QWidget { diff --git a/src/libaudqt/log-inspector.cc b/src/libaudqt/log-inspector.cc index a5d5440..028f757 100644 --- a/src/libaudqt/log-inspector.cc +++ b/src/libaudqt/log-inspector.cc @@ -67,8 +67,9 @@ public: protected: int rowCount(const QModelIndex & parent = QModelIndex()) const { - return m_entries.len(); + return parent.isValid() ? 0 : m_entries.len(); } + int columnCount(const QModelIndex & parent = QModelIndex()) const { return LogEntryColumn::Count; diff --git a/src/libaudqt/prefs-plugin.cc b/src/libaudqt/prefs-plugin.cc index 473d9bc..a7f6e94 100644 --- a/src/libaudqt/prefs-plugin.cc +++ b/src/libaudqt/prefs-plugin.cc @@ -17,8 +17,11 @@ * the use of this software. */ +#include <memory> + #include <QDialog> #include <QDialogButtonBox> +#include <QPointer> #include <QPushButton> #include <QVBoxLayout> @@ -29,6 +32,7 @@ #include <libaudcore/preferences.h> #include <libaudcore/runtime.h> +#include "libaudqt-internal.h" #include "libaudqt.h" namespace audqt @@ -61,17 +65,19 @@ EXPORT void plugin_about(PluginHandle * ph) struct ConfigWindow { PluginHandle * ph; - QDialog * root; + QPointer<QDialog> root; + + ~ConfigWindow() { delete root; } }; -static Index<ConfigWindow *> config_windows; +static Index<std::unique_ptr<ConfigWindow>> config_windows; static ConfigWindow * find_config_window(PluginHandle * ph) { - for (ConfigWindow * cw : config_windows) + for (auto & cw : config_windows) { if (cw && cw->ph == ph) - return cw; + return cw.get(); } return nullptr; @@ -108,11 +114,9 @@ EXPORT void plugin_prefs(PluginHandle * ph) if (p->init) p->init(); - QObject::connect(cw->root, &QObject::destroyed, [p, cw]() { + QObject::connect(cw->root.data(), &QObject::destroyed, [p]() { if (p->cleanup) p->cleanup(); - - cw->root = nullptr; }); const char * name = header->info.name; @@ -147,7 +151,7 @@ EXPORT void plugin_prefs(PluginHandle * ph) ->setText(translate_str(N_("_Close"))); } - QObject::connect(bbox, &QDialogButtonBox::rejected, cw->root, + QObject::connect(bbox, &QDialogButtonBox::rejected, cw->root.data(), &QObject::deleteLater); vbox->addWidget(bbox); @@ -155,4 +159,6 @@ EXPORT void plugin_prefs(PluginHandle * ph) window_bring_to_front(cw->root); } +void plugin_prefs_hide(void) { config_windows.clear(); } + } // namespace audqt diff --git a/src/libaudqt/queue-manager-qt.cc b/src/libaudqt/queue-manager-qt.cc index 2cf53bd..dd1e993 100644 --- a/src/libaudqt/queue-manager-qt.cc +++ b/src/libaudqt/queue-manager-qt.cc @@ -50,7 +50,11 @@ public: const QItemSelection & deselected); protected: - int rowCount(const QModelIndex & parent) const { return m_rows; } + int rowCount(const QModelIndex & parent) const + { + return parent.isValid() ? 0 : m_rows; + } + int columnCount(const QModelIndex & parent) const { return 2; } QVariant data(const QModelIndex & index, int role) const; diff --git a/src/libaudtag/ape/ape.cc b/src/libaudtag/ape/ape.cc index fa93f27..b94019e 100644 --- a/src/libaudtag/ape/ape.cc +++ b/src/libaudtag/ape/ape.cc @@ -44,7 +44,8 @@ struct APEHeader { #pragma pack(pop) struct ValuePair { - String key, value; + String key; + Index<char> value; }; #define APE_FLAG_HAS_HEADER (1 << 31) @@ -193,17 +194,19 @@ static const char * ape_read_item (const char * data, int length, ValuePair & pa value ++; - if (header[0] > (unsigned) (data + length - value)) + uint32_t value_len = FROM_LE32 (header[0]); + if (value_len > (unsigned) (data + length - value)) { AUDWARN ("Item value of length %d, but only %d bytes remain in tag.\n", - (int) header[0], (int) (data + length - value)); + (int) value_len, (int) (data + length - value)); return nullptr; } pair.key = String (data + 8); - pair.value = String (str_copy (value, header[0])); + pair.value.insert (value, -1, value_len); + pair.value.append (0); - return value + header[0]; + return value + value_len; } static Index<ValuePair> ape_read_items (VFSFile & handle) @@ -233,7 +236,7 @@ static Index<ValuePair> ape_read_items (VFSFile & handle) if (! (item = ape_read_item (item, data.end () - item, pair))) break; - AUDDBG ("Read: %s = %s.\n", (const char *) pair.key, (const char *) pair.value); + AUDDBG ("Read: %s = %s.\n", (const char *) pair.key, pair.value.begin ()); list.append (std::move (pair)); } @@ -247,27 +250,27 @@ bool APETagModule::read_tag (VFSFile & handle, Tuple & tuple, Index<char> * imag for (const ValuePair & pair : list) { if (! strcmp_nocase (pair.key, "Artist")) - tuple.set_str (Tuple::Artist, pair.value); + tuple.set_str (Tuple::Artist, pair.value.begin ()); else if (! strcmp_nocase (pair.key, "Title")) - tuple.set_str (Tuple::Title, pair.value); + tuple.set_str (Tuple::Title, pair.value.begin ()); else if (! strcmp_nocase (pair.key, "Album")) - tuple.set_str (Tuple::Album, pair.value); + tuple.set_str (Tuple::Album, pair.value.begin ()); else if (! strcmp_nocase (pair.key, "Comment")) - tuple.set_str (Tuple::Comment, pair.value); + tuple.set_str (Tuple::Comment, pair.value.begin ()); else if (! strcmp_nocase (pair.key, "Genre")) - tuple.set_str (Tuple::Genre, pair.value); + tuple.set_str (Tuple::Genre, pair.value.begin ()); else if (! strcmp_nocase (pair.key, "Track")) - tuple.set_int (Tuple::Track, atoi (pair.value)); + tuple.set_int (Tuple::Track, atoi (pair.value.begin ())); else if (! strcmp_nocase (pair.key, "Year")) - tuple.set_int (Tuple::Year, atoi (pair.value)); + tuple.set_int (Tuple::Year, atoi (pair.value.begin ())); else if (! strcmp_nocase (pair.key, "REPLAYGAIN_TRACK_GAIN")) - tuple.set_gain (Tuple::TrackGain, Tuple::GainDivisor, pair.value); + tuple.set_gain (Tuple::TrackGain, Tuple::GainDivisor, pair.value.begin ()); else if (! strcmp_nocase (pair.key, "REPLAYGAIN_TRACK_PEAK")) - tuple.set_gain (Tuple::TrackPeak, Tuple::PeakDivisor, pair.value); + tuple.set_gain (Tuple::TrackPeak, Tuple::PeakDivisor, pair.value.begin ()); else if (! strcmp_nocase (pair.key, "REPLAYGAIN_ALBUM_GAIN")) - tuple.set_gain (Tuple::AlbumGain, Tuple::GainDivisor, pair.value); + tuple.set_gain (Tuple::AlbumGain, Tuple::GainDivisor, pair.value.begin ()); else if (! strcmp_nocase (pair.key, "REPLAYGAIN_ALBUM_PEAK")) - tuple.set_gain (Tuple::AlbumPeak, Tuple::PeakDivisor, pair.value); + tuple.set_gain (Tuple::AlbumPeak, Tuple::PeakDivisor, pair.value.begin ()); } return true; @@ -393,7 +396,7 @@ bool APETagModule::write_tag (VFSFile & handle, const Tuple & tuple) ! strcmp_nocase (pair.key, "Year")) continue; - if (! ape_write_item (handle, pair.key, pair.value, & length)) + if (! ape_write_item (handle, pair.key, pair.value.begin (), & length)) return false; items ++; |