From 27310b1858e1de4aa1301021a48132d031b94d7a Mon Sep 17 00:00:00 2001 From: Daniel Clarke Date: Fri, 26 Sep 2014 15:58:40 -0400 Subject: [PATCH] Fixed the segfault with updatemanager and disabled updatemanager on linux (for now) Also fixed the definitions via CMakeLists.txt which was picking up extra quotes. Finalized PKGBUILD --- CMakeLists.txt | 4 ++-- etc/sbin/pkgbuild/PKGBUILD | 4 ++-- src/Baka-MPlayer.pro | 2 +- src/ui/mainwindow.cpp | 6 +++++- src/updatemanager.cpp | 3 ++- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f29e1c8..60acc3c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,8 +51,8 @@ include_directories( ${MPV_INCLUDE_DIRS} ) add_definitions( - -DBAKA_MPLAYER_VERSION="\\"${BAKA_MPLAYER_VERSION}\\"" - -DSETTINGS_FILE="\\"bakamplayer\\"" + -DBAKA_MPLAYER_VERSION="${BAKA_MPLAYER_VERSION}" + -DSETTINGS_FILE="bakamplayer" ${Qt5Core_DEFINITIONS} ${Qt5Gui_DEFINITIONS} ${Qt5Network_DEFINITIONS} diff --git a/etc/sbin/pkgbuild/PKGBUILD b/etc/sbin/pkgbuild/PKGBUILD index b9235856..bc6dc52f 100644 --- a/etc/sbin/pkgbuild/PKGBUILD +++ b/etc/sbin/pkgbuild/PKGBUILD @@ -34,6 +34,6 @@ package() { install -D "etc/doc/baka-mplayer.md" "$pkgdir/usr/share/doc/baka-mplayer/baka-mplayer.md" install -D "etc/doc/baka-mplayer.1.gz" "$pkgdir/usr/share/man/man1/baka-mplayer.1.gz" install -D "LICENSE" "$pkgdir/usr/share/licenses/baka-mplayer/LICENSE" - install -D "$srcdir/baka-mplayer.svg" "$pkgdir/usr/share/pixmaps/baka-mplayer.svg" - install -D "$srcdir/baka-mplayer.desktop" "$pkgdir/usr/share/applications/baka-mplayer.desktop" + install -D "$srcdir/baka-mplayer.svg" "$pkgdir/usr/share/pixmaps/baka-mplayer.svg" + install -D "$srcdir/baka-mplayer.desktop" "$pkgdir/usr/share/applications/baka-mplayer.desktop" } diff --git a/src/Baka-MPlayer.pro b/src/Baka-MPlayer.pro index 850740ad..5994f879 100644 --- a/src/Baka-MPlayer.pro +++ b/src/Baka-MPlayer.pro @@ -9,7 +9,7 @@ QT += core gui network greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = Baka-MPlayer -DEFINES += 'BAKA_MPLAYER_VERSION=\\"1.9.8\\"' \ +DEFINES += 'BAKA_MPLAYER_VERSION=\\"1.9.9\\"' \ 'SETTINGS_FILE=\\"bakamplayer\\"' TEMPLATE = app diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index d0781220..68b7da1e 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -64,8 +64,12 @@ MainWindow::MainWindow(QWidget *parent): settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, SETTINGS_FILE, QString(), this); #endif mpv = new MpvHandler(ui->mpvFrame->winId(), this); +#if defined(Q_OS_WIN) update = new UpdateManager(this); - +#else + // todo: remove this when checking for updates shows the latest version on linux + ui->action_Check_for_Updates->setEnabled(false); +#endif // initialize other ui elements // note: trayIcon does not work in my environment--known qt bug // see: https://bugreports.qt-project.org/browse/QTBUG-34364 diff --git a/src/updatemanager.cpp b/src/updatemanager.cpp index d106137f..b7024d95 100644 --- a/src/updatemanager.cpp +++ b/src/updatemanager.cpp @@ -27,7 +27,8 @@ void UpdateManager::CheckForUpdates() QList pair; for(auto line : lines) { - pair = line.split('='); + if((pair = line.split('=')).size() != 2) + break; info[QString(pair[0])] = QString(pair[1].replace('\r','\n')); // for multi-line info use \r's instead of \n's } emit Update(info);