Code maintenance for Qt 5:

- LinksCloud
- VOIP
- FeedReader


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6853 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2013-10-20 00:56:34 +00:00
parent c8b8daf110
commit 41ba665813
13 changed files with 48 additions and 10 deletions

View File

@ -10,8 +10,10 @@ linux-g++-64 {
}
win32 {
# from Qt 4.7.4 and 4.8+ the mkspecs has changed making dyn libs unusable anymore on windows : QMAKE_LFLAGS =
QMAKE_LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
lessThan(QT_MAJOR_VERSION, 5) {
# from Qt 4.7.4 and 4.8+ the mkspecs has changed making dyn libs unusable anymore on windows : QMAKE_LFLAGS =
QMAKE_LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
}
# Switch on extra warnings
QMAKE_CFLAGS += -Wextra
@ -22,7 +24,7 @@ win32 {
RCC_DIR = temp/qrc
UI_DIR = temp/ui
DEFINES += WINDOWS_SYS WIN32 STATICLIB MINGW
DEFINES += WINDOWS_SYS WIN32 STATICLIB MINGW WIN32_LEAN_AND_MEAN _USE_32BIT_TIME_T
DEFINES += MINIUPNPC_VERSION=13
# DESTDIR = lib

View File

@ -2,6 +2,11 @@
CONFIG += qt uic qrc resources
greaterThan(QT_MAJOR_VERSION, 4) {
# Qt 5
QT += widgets
}
SOURCES = FeedReaderPlugin.cpp \
services/p3FeedReader.cc \
services/p3FeedReaderThread.cc \

View File

@ -15,6 +15,7 @@
#include "gui/common/RSTreeWidgetItem.h"
#include "gui/settings/rsharesettings.h"
#include "util/HandleRichText.h"
#include "util/QtVersion.h"
#include "retroshare/rsiface.h"
@ -78,7 +79,7 @@ FeedReaderMessageWidget::FeedReaderMessageWidget(const std::string &feedId, RsFe
/* set header resize modes and initial section sizes */
QHeaderView *header = ui->msgTreeWidget->header();
header->setResizeMode(COLUMN_MSG_TITLE, QHeaderView::Interactive);
QHeaderView_setSectionResizeMode(header, COLUMN_MSG_TITLE, QHeaderView::Interactive);
header->resizeSection(COLUMN_MSG_TITLE, 350);
header->resizeSection(COLUMN_MSG_PUBDATE, 140);
header->resizeSection(COLUMN_MSG_AUTHOR, 150);
@ -98,7 +99,7 @@ FeedReaderMessageWidget::FeedReaderMessageWidget(const std::string &feedId, RsFe
/* Set header sizes for the fixed columns and resize modes, must be set after processSettings */
header->resizeSection(COLUMN_MSG_READ, 24);
header->setResizeMode(COLUMN_MSG_READ, QHeaderView::Fixed);
QHeaderView_setSectionResizeMode(header, COLUMN_MSG_READ, QHeaderView::Fixed);
/* build menu for link button */
QMenu *menu = new QMenu(this);

View File

@ -2,6 +2,11 @@
CONFIG += qt uic qrc resources
greaterThan(QT_MAJOR_VERSION, 4) {
# Qt 5
QT += widgets
}
SOURCES = p3ranking.cc LinksDialog.cpp rsrankitems.cc AddLinksDialog.cpp LinksCloudPlugin.cpp
HEADERS = rsrank.h p3ranking.h LinksDialog.h rsrankitems.h AddLinksDialog.h LinksCloudPlugin.h
FORMS = LinksDialog.ui AddLinksDialog.ui

View File

@ -28,6 +28,7 @@
#include <gui/RetroShareLink.h>
#include "AddLinksDialog.h"
#include "rsrank.h"
#include "util/QtVersion.h"
#include <sstream>
@ -81,9 +82,9 @@ LinksDialog::LinksDialog(RsPeers *peers, RsFiles *files, QWidget *parent)
/* Set header resize modes and initial section sizes */
QHeaderView * _header = ui.linkTreeWidget->header () ;
_header->setResizeMode (0, QHeaderView::Interactive);
_header->setResizeMode (1, QHeaderView::Interactive);
_header->setResizeMode (2, QHeaderView::Interactive);
QHeaderView_setSectionResizeMode(_header, 0, QHeaderView::Interactive);
QHeaderView_setSectionResizeMode(_header, 1, QHeaderView::Interactive);
QHeaderView_setSectionResizeMode(_header, 2, QHeaderView::Interactive);
_header->resizeSection ( 0, 400 );
_header->resizeSection ( 1, 60 );

View File

@ -1,5 +1,10 @@
!include("../Common/retroshare_plugin.pri"): error("Could not include file ../Common/retroshare_plugin.pri")
greaterThan(QT_MAJOR_VERSION, 4) {
# Qt 5
QT += widgets
}
exists($$[QMAKE_MKSPECS]/features/mobility.prf) {
CONFIG += mobility
} else {

View File

@ -5,6 +5,7 @@
#include <QApplication>
#include <QString>
#include <QIcon>
#include <QMessageBox>
#include "VOIPPlugin.h"
#include "interface/rsvoip.h"

View File

@ -29,6 +29,8 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <QTimer>
//#include "AudioInput.h"
//#include "AudioOutput.h"
#include "AudioStats.h"

View File

@ -30,6 +30,8 @@
#define iroundf(x) ( static_cast<int>(x) )
#include <QPainter>
#include "AudioStats.h"
#include "AudioInputConfig.h"
//#include "Global.h"

View File

@ -31,8 +31,7 @@
#ifndef _AUDIOSTATS_H
#define _AUDIOSTATS_H
#include <QtCore>
#include <QtGui>
#include <QWidget>
//#include "mumble_pch.hpp"

View File

@ -28,6 +28,8 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <QTimer>
#include "AudioWizard.h"
//#include "AudioInput.h"
//#include "Global.h"

View File

@ -40,6 +40,9 @@
#include "ui_AudioWizard.h"
class QGraphicsScene;
class QGraphicsItem;
class AudioWizard: public QWizard, public Ui::AudioWizard {
private:
Q_OBJECT

View File

@ -8,8 +8,13 @@ AudioDeviceHelper::AudioDeviceHelper()
QAudioInput* AudioDeviceHelper::getDefaultInputDevice()
{
QAudioFormat fmt;
#if QT_VERSION >= QT_VERSION_CHECK (5, 0, 0)
fmt.setSampleRate(16000);
fmt.setChannelCount(1);
#else
fmt.setFrequency(16000);
fmt.setChannels(1);
#endif
fmt.setSampleSize(16);
fmt.setSampleType(QAudioFormat::SignedInt);
fmt.setByteOrder(QAudioFormat::LittleEndian);
@ -45,8 +50,13 @@ QAudioInput* AudioDeviceHelper::getPreferedInputDevice() {
QAudioOutput* AudioDeviceHelper::getDefaultOutputDevice() {
QAudioFormat fmt;
#if QT_VERSION >= QT_VERSION_CHECK (5, 0, 0)
fmt.setSampleRate(16000);
fmt.setChannelCount(1);
#else
fmt.setFrequency(16000);
fmt.setChannels(1);
#endif
fmt.setSampleSize(16);
fmt.setSampleType(QAudioFormat::SignedInt);
fmt.setByteOrder(QAudioFormat::LittleEndian);