Unset URL handlers on exit( as specified by Qt).

Fix uppercase avatar initials.
This commit is contained in:
Julien Wadel 2023-02-23 10:23:14 +01:00
parent 3118e96ff9
commit bf9463469a
4 changed files with 10 additions and 4 deletions

View file

@ -84,6 +84,8 @@ public:
return mImageListModel;
}
QLocale getLocale () const;
//static ColorListModel *getColorListModel () const {
//return App::getInstance()-getColorListModel();
//}
@ -143,8 +145,6 @@ private:
QString getConfigLocale () const;
void setConfigLocale (const QString &locale);
QLocale getLocale () const;
QVariantList getAvailableLocales () const {
return mAvailableLocales;
}

View file

@ -31,6 +31,11 @@ UrlHandlers::UrlHandlers (QObject *parent) : QObject(parent) {
QDesktopServices::setUrlHandler("sips", this, "handleSip");
}
UrlHandlers::~UrlHandlers(){
QDesktopServices::unsetUrlHandler("sips");
QDesktopServices::unsetUrlHandler("sip");
}
void UrlHandlers::handleSip (const QUrl &url) {
emit sip(SipAddressesModel::interpretSipAddress(url));
}

View file

@ -26,10 +26,11 @@
// =============================================================================
class UrlHandlers : public QObject {
Q_OBJECT;
Q_OBJECT
public:
UrlHandlers (QObject *parent = Q_NULLPTR);
~UrlHandlers();
public slots:
void handleSip (const QUrl &url);

View file

@ -140,7 +140,7 @@ QString Utils::getInitials(const QString& username){
initials << QString::fromStdU32String(char32);
}
}
return initials.join("");
return App::getInstance()->getLocale().toUpper(initials.join(""));
}
QString Utils::toString(const LinphoneEnums::TunnelMode& mode){