forked from qt-creator/qt-creator
PasteSelectDialog: Fix after refactoring
Don't compare int with QString - which even compiles with Qt 5 (but
luckily doesn't with Qt 6).
Amends 123133841e
Change-Id: I347568c89658896a2e094610dbf1700ff84d81c5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -317,7 +317,7 @@ void CodePasterPluginPrivate::fetch()
|
|||||||
const QString pasteID = dialog.pasteId();
|
const QString pasteID = dialog.pasteId();
|
||||||
if (pasteID.isEmpty())
|
if (pasteID.isEmpty())
|
||||||
return;
|
return;
|
||||||
Protocol *protocol = m_protocols[dialog.protocolIndex()];
|
Protocol *protocol = m_protocols[dialog.protocol()];
|
||||||
if (Protocol::ensureConfiguration(protocol))
|
if (Protocol::ensureConfiguration(protocol))
|
||||||
protocol->fetch(pasteID);
|
protocol->fetch(pasteID);
|
||||||
}
|
}
|
||||||
|
@@ -89,15 +89,15 @@ int PasteSelectDialog::protocol() const
|
|||||||
return m_ui.protocolBox->currentIndex();
|
return m_ui.protocolBox->currentIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
int PasteSelectDialog::protocolIndex() const
|
QString PasteSelectDialog::protocolName() const
|
||||||
{
|
{
|
||||||
return m_ui.protocolBox->currentIndex();
|
return m_ui.protocolBox->currentText();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PasteSelectDialog::listDone(const QString &name, const QStringList &items)
|
void PasteSelectDialog::listDone(const QString &name, const QStringList &items)
|
||||||
{
|
{
|
||||||
// Set if the protocol is still current
|
// Set if the protocol is still current
|
||||||
if (name == protocol()) {
|
if (name == protocolName()) {
|
||||||
m_ui.listWidget->clear();
|
m_ui.listWidget->clear();
|
||||||
m_ui.listWidget->addItems(items);
|
m_ui.listWidget->addItems(items);
|
||||||
}
|
}
|
||||||
@@ -105,7 +105,7 @@ void PasteSelectDialog::listDone(const QString &name, const QStringList &items)
|
|||||||
|
|
||||||
void PasteSelectDialog::list()
|
void PasteSelectDialog::list()
|
||||||
{
|
{
|
||||||
const int index = protocolIndex();
|
const int index = protocol();
|
||||||
|
|
||||||
Protocol *protocol = m_protocols[index];
|
Protocol *protocol = m_protocols[index];
|
||||||
QTC_ASSERT((protocol->capabilities() & Protocol::ListCapability), return);
|
QTC_ASSERT((protocol->capabilities() & Protocol::ListCapability), return);
|
||||||
|
@@ -47,9 +47,8 @@ public:
|
|||||||
int protocol() const;
|
int protocol() const;
|
||||||
void setProtocol(const QString &);
|
void setProtocol(const QString &);
|
||||||
|
|
||||||
int protocolIndex() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QString protocolName() const;
|
||||||
void protocolChanged(int);
|
void protocolChanged(int);
|
||||||
void list();
|
void list();
|
||||||
void listDone(const QString &name, const QStringList &items);
|
void listDone(const QString &name, const QStringList &items);
|
||||||
|
Reference in New Issue
Block a user