mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge pull request #3488
Diadlo (1): style(toxid, widgets): Made constructor explicit
This commit is contained in:
commit
eb1e0091c4
|
@ -41,9 +41,9 @@ class ToxId
|
|||
public:
|
||||
ToxId(); ///< The default constructor. Creates an empty Tox ID.
|
||||
ToxId(const ToxId& other); ///< The copy constructor.
|
||||
ToxId(const QString& id); ///< Create a Tox ID from QString.
|
||||
/// If the given id is not a valid Tox ID, then:
|
||||
/// publicKey == id and noSpam == "" == checkSum.
|
||||
explicit ToxId(const QString& id); ///< Create a Tox ID from QString.
|
||||
/// If the given id is not a valid Tox ID, then:
|
||||
/// publicKey == id and noSpam == "" == checkSum.
|
||||
|
||||
bool operator==(const ToxId& other) const; ///< Compares only publicKey.
|
||||
bool operator!=(const ToxId& other) const; ///< Compares only publicKey.
|
||||
|
|
|
@ -94,7 +94,8 @@ void AboutUser::onSelectDirClicked()
|
|||
*/
|
||||
void AboutUser::onAcceptedClicked()
|
||||
{
|
||||
Settings::getInstance().setContactNote(ui->publicKey->text(), ui->note->toPlainText());
|
||||
ToxId toxId = ToxId(ui->publicKey->text());
|
||||
Settings::getInstance().setContactNote(toxId, ui->note->toPlainText());
|
||||
Settings::getInstance().saveGlobal();
|
||||
}
|
||||
|
||||
|
|
|
@ -523,7 +523,7 @@ void ProfileForm::onRegisterButtonClicked()
|
|||
Core* oldCore = Core::getInstance();
|
||||
|
||||
Toxme::ExecCode code = Toxme::ExecCode::Ok;
|
||||
QString response = Toxme::createAddress(code, server, id, name, privacy, bio);
|
||||
QString response = Toxme::createAddress(code, server, ToxId(id), name, privacy, bio);
|
||||
|
||||
Core* newCore = Core::getInstance();
|
||||
// Make sure the user didn't logout (or logout and login)
|
||||
|
|
|
@ -62,7 +62,10 @@ void TabCompleter::buildCompletionList()
|
|||
for (auto name : group->getPeerList())
|
||||
{
|
||||
if (regex.indexIn(name) > -1)
|
||||
completionMap[name.toLower()] = name;
|
||||
{
|
||||
SortableString lower = SortableString(name.toLower());
|
||||
completionMap[lower] = name;
|
||||
}
|
||||
}
|
||||
|
||||
nextCompletion = completionMap.begin();
|
||||
|
|
|
@ -45,7 +45,7 @@ public slots:
|
|||
|
||||
private:
|
||||
struct SortableString {
|
||||
inline SortableString(const QString &n) : contents{n} {}
|
||||
explicit SortableString(const QString &n) : contents{n} {}
|
||||
bool operator<(const SortableString &other) const;
|
||||
QString contents;
|
||||
};
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
class PasswordEdit : public QLineEdit
|
||||
{
|
||||
public:
|
||||
PasswordEdit(QWidget *parent);
|
||||
explicit PasswordEdit(QWidget *parent);
|
||||
~PasswordEdit();
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Reference in New Issue
Block a user