changeset 547:8103ad8eef87

Merge from qt5 branch. Next release will require qt5
author Chris Cannam
date Thu, 09 May 2013 17:20:24 +0100
parents 4163ddee7c00 (current diff) 724ded575041 (diff)
children c928aa734e6b
files .hgsubstate configure main/Surveyer.cpp main/Surveyer.h
diffstat 12 files changed, 60 insertions(+), 239 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsub	Tue Apr 16 15:21:47 2013 +0100
+++ b/.hgsub	Thu May 09 17:20:24 2013 +0100
@@ -1,3 +1,4 @@
 svcore = https://code.soundsoftware.ac.uk/hg/svcore
 svgui = https://code.soundsoftware.ac.uk/hg/svgui
 svapp = https://code.soundsoftware.ac.uk/hg/svapp
+dataquay = https://bitbucket.org/breakfastquay/dataquay
--- a/.hgsubstate	Tue Apr 16 15:21:47 2013 +0100
+++ b/.hgsubstate	Thu May 09 17:20:24 2013 +0100
@@ -1,3 +1,4 @@
-ce71d2d9bdb71089346c0aa20b45a0f06ddea1e9 svapp
-84013dc0ed7749fbde799e255f8d494956d0c340 svcore
-9d8f6552014d5e4b5fe70d1737e815a07488fdf7 svgui
+345a563df58bc7f7069727e95a267843b29c41b8 dataquay
+6c66fb64db64b6e156adc331480f056f3f998464 svapp
+cefc9763dc0c29d4a66f3dbd81abf2fd5bd3fbcc svcore
+2146130d12366b1733151bac3a81e2a9076bfb5b svgui
--- a/acinclude.m4	Tue Apr 16 15:21:47 2013 +0100
+++ b/acinclude.m4	Thu May 09 17:20:24 2013 +0100
@@ -66,7 +66,7 @@
 AC_REQUIRE([AC_PROG_CXX])
 
 if test x$QMAKE = x ; then
-   	AC_CHECK_PROG(QMAKE, qmake-qt4, $QTDIR/bin/qmake-qt4,,$QTDIR/bin/)
+   	AC_CHECK_PROG(QMAKE, qmake-qt5, $QTDIR/bin/qmake-qt5,,$QTDIR/bin/)
 fi
 if test x$QMAKE = x ; then
    	AC_CHECK_PROG(QMAKE, qmake, $QTDIR/bin/qmake,,$QTDIR/bin/)
@@ -75,16 +75,16 @@
 	AC_CHECK_PROG(QMAKE, qmake.exe, $QTDIR/bin/qmake.exe,,$QTDIR/bin/)
 fi
 if test x$QMAKE = x ; then
-   	AC_CHECK_PROG(QMAKE, qmake-qt4, qmake-qt4,,$PATH)
+   	AC_CHECK_PROG(QMAKE, qmake-qt5, qmake-qt5,,$PATH)
 fi
 if test x$QMAKE = x ; then
    	AC_CHECK_PROG(QMAKE, qmake, qmake,,$PATH)
 fi
 if test x$QMAKE = x ; then
    	AC_MSG_ERROR([
-Failed to find the required qmake-qt4 or qmake program.  Please
-ensure you have the necessary Qt4 development files installed, and
-if necessary set QTDIR to the location of your Qt4 installation.
+Failed to find the required qmake-qt5 or qmake program.  Please
+ensure you have the necessary Qt5 development files installed, and
+if necessary set QTDIR to the location of your Qt5 installation.
 ])
 fi
 
@@ -98,11 +98,11 @@
 #
 QMAKE_VERSION_OUTPUT=`$QMAKE -v`
 case "$QMAKE_VERSION_OUTPUT" in
-     *2.*4.*) ;;
+     *5.*) ;;
      *) AC_MSG_WARN([
  *** The version of qmake found in "$QMAKE" looks like it might be
-     from the wrong version of Qt (Qt4 is required).  Please check
-     that this is the correct version of qmake for Qt4 builds.
+     from the wrong version of Qt (Qt5 is required).  Please check
+     that this is the correct version of qmake for Qt5 builds.
 ])
 esac
 
--- a/configure	Tue Apr 16 15:21:47 2013 +0100
+++ b/configure	Thu May 09 17:20:24 2013 +0100
@@ -3974,8 +3974,8 @@
 
 
 if test x$QMAKE = x ; then
-   	# Extract the first word of "qmake-qt4", so it can be a program name with args.
-set dummy qmake-qt4; ac_word=$2
+   	# Extract the first word of "qmake-qt5", so it can be a program name with args.
+set dummy qmake-qt5; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
 if ${ac_cv_prog_QMAKE+:} false; then :
@@ -3991,7 +3991,7 @@
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_QMAKE="$QTDIR/bin/qmake-qt4"
+    ac_cv_prog_QMAKE="$QTDIR/bin/qmake-qt5"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -4091,8 +4091,8 @@
 
 fi
 if test x$QMAKE = x ; then
-   	# Extract the first word of "qmake-qt4", so it can be a program name with args.
-set dummy qmake-qt4; ac_word=$2
+   	# Extract the first word of "qmake-qt5", so it can be a program name with args.
+set dummy qmake-qt5; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
 if ${ac_cv_prog_QMAKE+:} false; then :
@@ -4108,7 +4108,7 @@
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_QMAKE="qmake-qt4"
+    ac_cv_prog_QMAKE="qmake-qt5"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -4170,9 +4170,9 @@
 fi
 if test x$QMAKE = x ; then
    	as_fn_error $? "
-Failed to find the required qmake-qt4 or qmake program.  Please
-ensure you have the necessary Qt4 development files installed, and
-if necessary set QTDIR to the location of your Qt4 installation.
+Failed to find the required qmake-qt5 or qmake program.  Please
+ensure you have the necessary Qt5 development files installed, and
+if necessary set QTDIR to the location of your Qt5 installation.
 " "$LINENO" 5
 fi
 
@@ -4186,16 +4186,16 @@
 #
 QMAKE_VERSION_OUTPUT=`$QMAKE -v`
 case "$QMAKE_VERSION_OUTPUT" in
-     *2.*4.*) ;;
+     *5.*) ;;
      *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
  *** The version of qmake found in \"$QMAKE\" looks like it might be
-     from the wrong version of Qt (Qt4 is required).  Please check
-     that this is the correct version of qmake for Qt4 builds.
+     from the wrong version of Qt (Qt5 is required).  Please check
+     that this is the correct version of qmake for Qt5 builds.
 " >&5
 $as_echo "$as_me: WARNING:
  *** The version of qmake found in \"$QMAKE\" looks like it might be
-     from the wrong version of Qt (Qt4 is required).  Please check
-     that this is the correct version of qmake for Qt4 builds.
+     from the wrong version of Qt (Qt5 is required).  Please check
+     that this is the correct version of qmake for Qt5 builds.
 " >&2;}
 esac
 
--- a/main/MainWindow.cpp	Tue Apr 16 15:21:47 2013 +0100
+++ b/main/MainWindow.cpp	Thu May 09 17:20:24 2013 +0100
@@ -82,7 +82,6 @@
 #include "rdf/PluginRDFIndexer.h"
 #include "rdf/RDFExporter.h"
 
-#include "Surveyer.h"
 #include "framework/VersionTester.h"
 
 // For version information
@@ -307,7 +306,6 @@
     
     TransformFactory::getInstance()->startPopulationThread();
 
-    Surveyer *surveyer = new Surveyer(this);
     VersionTester *vt = new VersionTester
         ("sonicvisualiser.org", "/latest-version.txt", SV_VERSION);
     connect(vt, SIGNAL(newerVersionAvailable(QString)),
@@ -1696,7 +1694,7 @@
             action->setShortcut(tr("Ctrl+R"));
             m_keyReference->registerShortcut
                 (tr("Re-open"),
-                 action->shortcut(),
+                 action->shortcut().toString(),
                  tr("Re-open the current or most recently opened file"));
         }
 	m_recentFilesMenu->addAction(action);
@@ -1772,7 +1770,7 @@
             ti->second->setShortcut(tr("Ctrl+T"));
             m_keyReference->registerShortcut
                 (tr("Repeat Transform"),
-                 ti->second->shortcut(),
+                 ti->second->shortcut().toString(),
                  tr("Re-select the most recently run transform"));
         } else {
             ti->second->setShortcut(QString(""));
--- a/main/PreferencesDialog.cpp	Tue Apr 16 15:21:47 2013 +0100
+++ b/main/PreferencesDialog.cpp	Thu May 09 17:20:24 2013 +0100
@@ -42,8 +42,8 @@
 #include "audioio/AudioTargetFactory.h"
 #include "base/ResourceFinder.h"
 
-PreferencesDialog::PreferencesDialog(QWidget *parent, Qt::WFlags flags) :
-    QDialog(parent, flags),
+PreferencesDialog::PreferencesDialog(QWidget *parent) :
+    QDialog(parent),
     m_audioDevice(0),
     m_changesOnRestart(false)
 {
--- a/main/PreferencesDialog.h	Tue Apr 16 15:21:47 2013 +0100
+++ b/main/PreferencesDialog.h	Thu May 09 17:20:24 2013 +0100
@@ -31,7 +31,7 @@
     Q_OBJECT
 
 public:
-    PreferencesDialog(QWidget *parent = 0, Qt::WFlags flags = 0);
+    PreferencesDialog(QWidget *parent = 0);
     virtual ~PreferencesDialog();
 
     enum Tab {
--- a/main/Surveyer.cpp	Tue Apr 16 15:21:47 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
-
-/*
-    Sonic Visualiser
-    An audio file viewer and annotation editor.
-    Centre for Digital Music, Queen Mary, University of London.
-    
-    This program 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.  See the file
-    COPYING included with this distribution for more information.
-*/
-
-/*
-   This is a modified version of a source file from the 
-   Rosegarden MIDI and audio sequencer and notation editor.
-   This file copyright 2000-2009 Chris Cannam.
-*/
-
-#include "Surveyer.h"
-
-#include <iostream>
-
-#include <QHttp>
-
-#include <QSettings>
-#include <QMessageBox>
-#include <QDesktopServices>
-#include <QPushButton>
-#include <QUrl>
-
-#include "version.h"
-
-#include "transform/TransformFactory.h"
-#include "plugin/PluginIdentifier.h"
-
-Surveyer::Surveyer(QObject *parent) :
-    QObject(parent),
-    m_httpFailed(false)
-{
-    QSettings settings;
-    settings.beginGroup("Survey");
-    if (!settings.contains("countdown")) {
-        settings.setValue("countdown", 15);
-        settings.endGroup();
-        return;
-    }
-    int countdown = settings.value("countdown").toInt();
-    if (countdown == 0) {
-        // The countdown value will now remain 0 until we have
-        // successfully tested for a survey and offered it to the
-        // user.  If the survey doesn't exist any more, then we'll
-        // simply never present it to the user and the countdown will
-        // remain 0 forever.  If the survey does exist, then we offer
-        // the user the chance to respond to it and (regardless of
-        // whether they want to or not) set the countdown to -1 so
-        // that it is never offered again.
-        QHttp *http = new QHttp();
-        connect(http, SIGNAL(responseHeaderReceived(const QHttpResponseHeader &)),
-                this, SLOT(httpResponseHeaderReceived(const QHttpResponseHeader &)));
-        connect(http, SIGNAL(done(bool)),
-                this, SLOT(httpDone(bool)));
-        http->setHost("sonicvisualiser.org");
-        http->get("/survey16-present.txt");
-    } else if (countdown > 0) {
-        settings.setValue("countdown", countdown-1);
-    }
-    settings.endGroup();
-}
-
-Surveyer::~Surveyer()
-{
-}
-
-void
-Surveyer::httpResponseHeaderReceived(const QHttpResponseHeader &h)
-{
-    if (h.statusCode() / 100 != 2) m_httpFailed = true;
-}
-
-void
-Surveyer::httpDone(bool error)
-{
-    QHttp *http = const_cast<QHttp *>(dynamic_cast<const QHttp *>(sender()));
-    if (!http) return;
-    http->deleteLater();
-//    if (error || m_httpFailed) return;
-
-    QByteArray responseData = http->readAll();
-    QString str = QString::fromUtf8(responseData.data());
-    QStringList lines = str.split('\n', QString::SkipEmptyParts);
-    if (lines.empty()) return;
-
-    QString response = lines[0];
-//    if (response != "yes") return;
-
-    QString title = "Sonic Visualiser - User Survey";
-    QString text = "<h3>Sonic Visualiser: Take part in our survey!</h3><p>We at Queen Mary, University of London are running a short survey for users of Sonic Visualiser.  We are trying to find out how useful Sonic Visualiser is to people, and what we can do to improve it.</p><p>We do not ask for any personal information, and it should only take five minutes.</p><p>Would you like to take part?</p>";
-
-    QMessageBox mb(dynamic_cast<QWidget *>(parent()));
-    mb.setWindowTitle(title);
-    mb.setText(text);
-
-    QPushButton *yes = mb.addButton(tr("Yes! Take me to the survey"), QMessageBox::ActionRole);
-    mb.addButton(tr("No, thanks"), QMessageBox::RejectRole);
-
-    mb.exec();
-
-    QSettings settings;
-    settings.beginGroup("Survey");
-    settings.setValue("countdown", -1);
-    settings.endGroup();
-
-    if (mb.clickedButton() == yes) {
-        QString svarg = SV_VERSION;
-        QString platformarg = "unknown";
-#ifdef _WIN32
-        platformarg = "win32";
-#else
-#ifdef __APPLE__
-        platformarg = "osx";
-#else
-        platformarg = "posix";
-#endif
-#endif
-        QString plugsarg;
-        TransformFactory *tf = TransformFactory::getInstance();
-        if (tf) {
-            TransformList tl = tf->getAllTransformDescriptions();
-            std::set<QString> packages;
-            for (size_t i = 0; i < tl.size(); ++i) {
-                TransformId id = tl[i].identifier;
-                Transform t;
-                t.setIdentifier(id);
-                QString plugid = t.getPluginIdentifier();
-                QString type, soname, label;
-                PluginIdentifier::parseIdentifier(plugid, type, soname, label);
-                if (type == "vamp") packages.insert(soname);
-            }
-            for (std::set<QString>::const_iterator i = packages.begin();
-                 i != packages.end(); ++i) {
-                if (plugsarg != "") plugsarg = plugsarg + ",";
-                plugsarg = plugsarg + *i;
-            }
-        }
-        QDesktopServices::openUrl(QUrl(QString("http://sonicvisualiser.org/survey16.php?sv=%1&plugs=%2&platform=%3").arg(svarg).arg(plugsarg).arg(platformarg)));
-    }
-}
-
-
--- a/main/Surveyer.h	Tue Apr 16 15:21:47 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
-
-/*
-    Sonic Visualiser
-    An audio file viewer and annotation editor.
-    Centre for Digital Music, Queen Mary, University of London.
-    
-    This program 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.  See the file
-    COPYING included with this distribution for more information.
-*/
-
-/*
-   This is a modified version of a source file from the 
-   Rosegarden MIDI and audio sequencer and notation editor.
-   This file copyright 2000-2009 Chris Cannam.
-*/
-
-#ifndef _SURVEYER_H_
-#define _SURVEYER_H_
-
-#include <QStringList>
-#include <QString>
-#include <QObject>
-
-class QHttpResponseHeader;
-
-class Surveyer : public QObject
-{
-    Q_OBJECT
-
-public:
-    Surveyer(QObject *parent = 0);
-    virtual ~Surveyer();
-
-protected slots:
-    void httpResponseHeaderReceived(const QHttpResponseHeader &);
-    void httpDone(bool);
-
-private:
-    bool m_httpFailed;
-};
-
-#endif
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/platform-dataquay.pri	Thu May 09 17:20:24 2013 +0100
@@ -0,0 +1,13 @@
+
+include(./config.pri)
+
+CONFIG += staticlib
+
+DEFINES -= USE_REDLAND
+QMAKE_CXXFLAGS -= -I/usr/include/rasqal -I/usr/include/raptor2
+EXTRALIBS -= -lrdf
+
+DEFINES += USE_SORD
+QMAKE_CXXFLAGS += -I/usr/local/include/sord-0 -I/usr/local/include/serd-0
+EXTRALIBS += -lsord-0 -lserd-0
+
--- a/sonic-visualiser.pro	Tue Apr 16 15:21:47 2013 +0100
+++ b/sonic-visualiser.pro	Thu May 09 17:20:24 2013 +0100
@@ -1,5 +1,5 @@
 TEMPLATE = subdirs
-SUBDIRS = svcore svgui svapp sub_sv svcore/data/fileio/test
+SUBDIRS = dataquay svcore svgui svapp sub_sv svcore/data/fileio/test
 
 sub_sv.file = sv.pro
 
--- a/sv.pro	Tue Apr 16 15:21:47 2013 +0100
+++ b/sv.pro	Thu May 09 17:20:24 2013 +0100
@@ -4,7 +4,7 @@
 include(config.pri)
 
 CONFIG += qt thread warn_on stl rtti exceptions
-QT += network xml gui
+QT += network xml gui widgets
 
 TARGET = "Sonic Visualiser"
 linux*:TARGET = sonic-visualiser
@@ -23,29 +23,35 @@
 
 contains(DEFINES, BUILD_STATIC):LIBS -= -ljack
 
-LIBS = -Lsvapp -Lsvgui -Lsvcore -lsvapp -lsvgui -lsvcore $$LIBS
+MY_LIBS = -Lsvapp -Lsvgui -Lsvcore -Ldataquay -lsvapp -lsvgui -lsvcore -ldataquay
+
+linux* {
+MY_LIBS = -Wl,-Bstatic $$MY_LIBS -Wl,-Bdynamic
+}
+
+LIBS = $$MY_LIBS $$LIBS
 
 win* {
 PRE_TARGETDEPS += svapp/svapp.lib \
                   svgui/svgui.lib \
-                  svcore/svcore.lib
+                  svcore/svcore.lib \
+                  dataquay/dataquay.lib
 }
 !win* {
 PRE_TARGETDEPS += svapp/libsvapp.a \
                   svgui/libsvgui.a \
-                  svcore/libsvcore.a
+                  svcore/libsvcore.a \
+                  dataquay/libdataquay.a
 }
 
 RESOURCES += sonic-visualiser.qrc
 
 HEADERS += main/MainWindow.h \
-           main/PreferencesDialog.h \
-           main/Surveyer.h
+           main/PreferencesDialog.h
 SOURCES += main/main.cpp \
            main/OSCHandler.cpp \
            main/MainWindow.cpp \
-           main/PreferencesDialog.cpp \
-           main/Surveyer.cpp
+           main/PreferencesDialog.cpp 
 
 # for mac integration
 QMAKE_INFO_PLIST = deploy/osx/Info.plist