Skip to content

Commit

Permalink
Convert mytharchive/importnative.cpp to use new style Qt connect func…
Browse files Browse the repository at this point in the history
…tion.

Using the newer "PMF" connect allows all of the function arguments to
be checked at compile time, instead of at run time.
  • Loading branch information
linuxdude42 committed Oct 29, 2020
1 parent 1b87308 commit c0f9a03
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions mythplugins/mytharchive/mytharchive/importnative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ void ImportNative::findChannelMatch(const QString &chanID, const QString &chanNo
}

void ImportNative::showList(const QString &caption, QString &value,
const char *slot)
const INSlot slot)
{
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");

Expand All @@ -516,7 +516,7 @@ void ImportNative::showList(const QString &caption, QString &value,
return;
}

connect(searchDialog, SIGNAL(haveResult(QString)), this, slot);
connect(searchDialog, &MythUISearchDialog::haveResult, this, slot);

popupStack->AddScreen(searchDialog);
}
Expand Down Expand Up @@ -547,7 +547,7 @@ void ImportNative::searchChanID()
fillSearchList("chanid");

s = m_chanIDText->GetText();
showList(tr("Select a channel id"), s, SLOT(gotChanID(QString)));
showList(tr("Select a channel id"), s, &ImportNative::gotChanID);
}

void ImportNative::gotChanID(const QString& value)
Expand All @@ -573,7 +573,7 @@ void ImportNative::searchChanNo()
fillSearchList("channum");

s = m_chanNoText->GetText();
showList(tr("Select a channel number"), s, SLOT(gotChanNo(QString)));
showList(tr("Select a channel number"), s, &ImportNative::gotChanNo);
}

void ImportNative::gotChanNo(const QString& value)
Expand All @@ -599,7 +599,7 @@ void ImportNative::searchName()
fillSearchList("name");

s = m_chanNameText->GetText();
showList(tr("Select a channel name"), s, SLOT(gotName(QString)));
showList(tr("Select a channel name"), s, &ImportNative::gotName);
}

void ImportNative::gotName(const QString& value)
Expand All @@ -625,7 +625,7 @@ void ImportNative::searchCallsign()
fillSearchList("callsign");

s = m_callsignText->GetText();
showList(tr("Select a Callsign"), s, SLOT(gotCallsign(QString)));
showList(tr("Select a Callsign"), s, &ImportNative::gotCallsign);
}

void ImportNative::gotCallsign(const QString& value)
Expand Down
3 changes: 2 additions & 1 deletion mythplugins/mytharchive/mytharchive/importnative.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ class ImportNative : public MythScreenType
void findChannelMatch(const QString &chanid, const QString &chanNo,
const QString &name, const QString &callsign);
void fillSearchList(const QString &field);
void showList(const QString &caption, QString &value, const char *slot);
using INSlot = void (ImportNative::*)(const QString&);
void showList(const QString &caption, QString &value, INSlot slot);

QString m_xmlFile;
FileDetails m_details;
Expand Down

0 comments on commit c0f9a03

Please sign in to comment.