Skip to content

Commit

Permalink
Fixed deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri0n committed Mar 17, 2024
1 parent ebd549c commit 4b93355
Show file tree
Hide file tree
Showing 22 changed files with 191 additions and 138 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/qite
4 changes: 2 additions & 2 deletions src/avcall/jinglertp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ class JingleRtpPrivate : public QObject {
iceA_status.remotePassword = audioContent->trans.pass;
}

printf("audio candidates=%d\n", audioContent->trans.candidates.count());
printf("audio candidates=%lld\n", audioContent->trans.candidates.count());
iceA_status.remoteCandidates += audioContent->trans.candidates;
}
if (videoContent) {
Expand All @@ -610,7 +610,7 @@ class JingleRtpPrivate : public QObject {
iceV_status.remotePassword = videoContent->trans.pass;
}

printf("video candidates=%d\n", videoContent->trans.candidates.count());
printf("video candidates=%lld\n", videoContent->trans.candidates.count());
iceV_status.remoteCandidates += videoContent->trans.candidates;
}

Expand Down
4 changes: 2 additions & 2 deletions src/coloropt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ ColorOpt *ColorOpt::instance()
{
if (!instance_)
instance_.reset(new ColorOpt());
return instance_.data();
return instance_.get();
}

void ColorOpt::reset() { instance_.reset(nullptr); }

QScopedPointer<ColorOpt> ColorOpt::instance_;
std::unique_ptr<ColorOpt> ColorOpt::instance_;
4 changes: 2 additions & 2 deletions src/coloropt.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ private slots:
void optionChanged(const QString &opt);

private:
static QScopedPointer<ColorOpt> instance_;
QHash<QString, ColorData> colors;
static std::unique_ptr<ColorOpt> instance_;
QHash<QString, ColorData> colors;
};
2 changes: 1 addition & 1 deletion src/filesharingdownloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ class FileShareDownloader::Private : public QObject {
Jingle::FileTransfer::File file;
QList<Jid> jids;
QStringList uris; // sorted from low priority to high.
QScopedPointer<QFile> tmpFile;
std::unique_ptr<QFile> tmpFile;
QString dstFileName;
QString lastError;
qint64 rangeStart = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/filesharingdownloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ class FileShareDownloader : public QIODevice {

private:
class Private;
QScopedPointer<Private> d;
std::unique_ptr<Private> d;
};
2 changes: 1 addition & 1 deletion src/filesharingmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public slots:

private:
class Private;
QScopedPointer<Private> d;
std::unique_ptr<Private> d;
};

class FileSharingDeviceOpener : public ITEMediaOpener {
Expand Down
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ void PsiMain::chooseProfile()
PsiIconset::instance()->loadSystem();

while (1) {
QScopedPointer<ProfileOpenDlg> w(new ProfileOpenDlg(lastProfile,
TranslationManager::instance()->availableTranslations(),
TranslationManager::instance()->currentLanguage()));
std::unique_ptr<ProfileOpenDlg> w(new ProfileOpenDlg(lastProfile,
TranslationManager::instance()->availableTranslations(),
TranslationManager::instance()->currentLanguage()));
w->ck_auto->setChecked(autoOpen);
int r = w->exec();
// lang change
Expand Down
3 changes: 2 additions & 1 deletion src/mucconfigdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ void MUCConfigDlg::apply()
void MUCConfigDlg::destroy()
{
int i = QMessageBox::warning(this, tr("Destroy room"),
tr("Are you absolutely certain you want to destroy this room?"), tr("Yes"), tr("No"));
tr("Are you absolutely certain you want to destroy this room?"),
QMessageBox::Yes | QMessageBox::No);
if (i == 0) {
manager_->destroy();
}
Expand Down
4 changes: 4 additions & 0 deletions src/multifiletransferdelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,11 @@ bool MultiFileTransferDelegate::editorEvent(QEvent *event, QAbstractItemModel *m
connect(menu->addAction(tr("Open Destination Folder")), &QAction::triggered, this,
[model, index]() { model->setData(index, 1, MultiFileTransferModel::OpenDirRole); });
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
menu->popup(me->globalPos());
#else
menu->popup(me->globalPosition().toPoint());
#endif
return true;
}
return false;
Expand Down
3 changes: 1 addition & 2 deletions src/multifiletransferdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#define MULTIFILETRANSFERDLG_H

#include <QDialog>
#include <QScopedPointer>

class MultiFileTransferItem;
class PsiAccount;
Expand Down Expand Up @@ -83,7 +82,7 @@ class MultiFileTransferDlg : public QDialog {
private:
Ui::MultiFileTransferDlg *ui;
class Private;
QScopedPointer<Private> d;
std::unique_ptr<Private> d;
};

#endif // MULTIFILETRANSFERDLG_H
4 changes: 1 addition & 3 deletions src/multifiletransferitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

#include "multifiletransfermodel.h"

#include <QScopedPointer>

class MultiFileTransferItem : public QObject {
Q_OBJECT
public:
Expand Down Expand Up @@ -71,7 +69,7 @@ public slots:
private:
friend class MultiFileTransferModel;
struct Private;
QScopedPointer<Private> d;
std::unique_ptr<Private> d;
};

#endif // MULTIFILETRANSFERITEM_H
9 changes: 8 additions & 1 deletion src/options/opt_appearance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ class OptAppearanceUI : public QWidget, public Ui::OptAppearance {

class OptAppearanceMiscUI : public QWidget, public Ui::OptAppearanceMisc {
public:
OptAppearanceMiscUI() : QWidget() { setupUi(this); }
OptAppearanceMiscUI() : QWidget()
{
// we could do that in UI. but see https://bugreports.qt.io/browse/QTBUG-123373
QObject::connect(sl_rosterop, &QSlider::valueChanged, lb_rosterop_val, qOverload<int>(&QLabel::setNum));
QObject::connect(sl_chatdlgop, &QSlider::valueChanged, lb_chatdlgop_val, qOverload<int>(&QLabel::setNum));

setupUi(this);
}
};

//----------------------------------------------------------------------------
Expand Down
143 changes: 54 additions & 89 deletions src/options/opt_appearance_misc.ui
Original file line number Diff line number Diff line change
@@ -1,49 +1,47 @@
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>OptAppearanceMisc</class>
<widget class="QWidget" name="OptAppearanceMisc" >
<property name="geometry" >
<widget class="QWidget" name="OptAppearanceMisc">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>354</width>
<height>189</height>
</rect>
</property>
<property name="windowTitle" >
<property name="windowTitle">
<string>OptAppearanceMiscUI</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin" stdset="0">
<number>9</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox4" >
<property name="title" >
<widget class="QGroupBox" name="groupBox4">
<property name="title">
<string>Headings</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<layout class="QGridLayout">
<property name="margin" stdset="0">
<number>8</number>
</property>
<property name="spacing" >
<property name="spacing">
<number>6</number>
</property>
<item row="1" column="0" >
<widget class="QCheckBox" name="ck_newHeadings" >
<property name="text" >
<item row="1" column="0">
<widget class="QCheckBox" name="ck_newHeadings">
<property name="text">
<string>Slim group headings</string>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QCheckBox" name="ck_outlineHeadings" >
<property name="text" >
<item row="0" column="0">
<widget class="QCheckBox" name="ck_outlineHeadings">
<property name="text">
<string>Outline headings</string>
</property>
</widget>
Expand All @@ -52,85 +50,85 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_opacity" >
<property name="title" >
<widget class="QGroupBox" name="gb_opacity">
<property name="title">
<string>Opacity</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<layout class="QGridLayout">
<property name="margin" stdset="0">
<number>8</number>
</property>
<property name="spacing" >
<property name="spacing">
<number>6</number>
</property>
<item row="1" column="1" >
<widget class="QSlider" name="sl_chatdlgop" >
<property name="minimum" >
<item row="1" column="1">
<widget class="QSlider" name="sl_chatdlgop">
<property name="minimum">
<number>10</number>
</property>
<property name="maximum" >
<property name="maximum">
<number>100</number>
</property>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="1" column="2" >
<widget class="QLabel" name="lb_chatdlgop_val" >
<property name="minimumSize" >
<item row="1" column="2">
<widget class="QLabel" name="lb_chatdlgop_val">
<property name="minimumSize">
<size>
<width>30</width>
<height>0</height>
</size>
</property>
<property name="text" >
<property name="text">
<string>100</string>
</property>
<property name="alignment" >
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QSlider" name="sl_rosterop" >
<property name="minimum" >
<item row="0" column="1">
<widget class="QSlider" name="sl_rosterop">
<property name="minimum">
<number>10</number>
</property>
<property name="maximum" >
<property name="maximum">
<number>100</number>
</property>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="lb_rosterop" >
<property name="text" >
<item row="0" column="0">
<widget class="QLabel" name="lb_rosterop">
<property name="text">
<string>Roster opacity:</string>
</property>
</widget>
</item>
<item row="0" column="2" >
<widget class="QLabel" name="lb_rosterop_val" >
<property name="minimumSize" >
<item row="0" column="2">
<widget class="QLabel" name="lb_rosterop_val">
<property name="minimumSize">
<size>
<width>30</width>
<height>0</height>
</size>
</property>
<property name="text" >
<property name="text">
<string>100</string>
</property>
<property name="alignment" >
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="lb_chatdlgop" >
<property name="text" >
<item row="1" column="0">
<widget class="QLabel" name="lb_chatdlgop">
<property name="text">
<string>Chat dialog opacity:</string>
</property>
</widget>
Expand All @@ -140,46 +138,13 @@
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<layoutdefault spacing="6" margin="11"/>
<tabstops>
<tabstop>ck_outlineHeadings</tabstop>
<tabstop>ck_newHeadings</tabstop>
<tabstop>sl_rosterop</tabstop>
<tabstop>sl_chatdlgop</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>sl_rosterop</sender>
<signal>valueChanged(int)</signal>
<receiver>lb_rosterop_val</receiver>
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel" >
<x>208</x>
<y>134</y>
</hint>
<hint type="destinationlabel" >
<x>320</x>
<y>134</y>
</hint>
</hints>
</connection>
<connection>
<sender>sl_chatdlgop</sender>
<signal>valueChanged(int)</signal>
<receiver>lb_chatdlgop_val</receiver>
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel" >
<x>208</x>
<y>159</y>
</hint>
<hint type="destinationlabel" >
<x>320</x>
<y>159</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>
Loading

0 comments on commit 4b93355

Please sign in to comment.