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();
|
||||
if (pasteID.isEmpty())
|
||||
return;
|
||||
Protocol *protocol = m_protocols[dialog.protocolIndex()];
|
||||
Protocol *protocol = m_protocols[dialog.protocol()];
|
||||
if (Protocol::ensureConfiguration(protocol))
|
||||
protocol->fetch(pasteID);
|
||||
}
|
||||
|
@@ -89,15 +89,15 @@ int PasteSelectDialog::protocol() const
|
||||
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)
|
||||
{
|
||||
// Set if the protocol is still current
|
||||
if (name == protocol()) {
|
||||
if (name == protocolName()) {
|
||||
m_ui.listWidget->clear();
|
||||
m_ui.listWidget->addItems(items);
|
||||
}
|
||||
@@ -105,7 +105,7 @@ void PasteSelectDialog::listDone(const QString &name, const QStringList &items)
|
||||
|
||||
void PasteSelectDialog::list()
|
||||
{
|
||||
const int index = protocolIndex();
|
||||
const int index = protocol();
|
||||
|
||||
Protocol *protocol = m_protocols[index];
|
||||
QTC_ASSERT((protocol->capabilities() & Protocol::ListCapability), return);
|
||||
|
@@ -47,9 +47,8 @@ public:
|
||||
int protocol() const;
|
||||
void setProtocol(const QString &);
|
||||
|
||||
int protocolIndex() const;
|
||||
|
||||
private:
|
||||
QString protocolName() const;
|
||||
void protocolChanged(int);
|
||||
void list();
|
||||
void listDone(const QString &name, const QStringList &items);
|
||||
|
Reference in New Issue
Block a user