Application: Use shared pointers

Fixes #1239
This commit is contained in:
Jonas Kvinge
2023-07-21 05:55:24 +02:00
parent d6b53f78ab
commit 2e61235403
316 changed files with 2170 additions and 1643 deletions

View File

@@ -24,10 +24,9 @@
#include <QtGlobal>
#include <glib.h>
#include <cstdlib>
#include <memory>
#include <ctime>
#include <memory>
#ifdef Q_OS_UNIX
# include <unistd.h>
@@ -43,6 +42,8 @@
# include <iostream>
#endif // Q_OS_WIN32
#include <glib.h>
#include <QObject>
#include <QApplication>
#include <QCoreApplication>
@@ -66,6 +67,9 @@
#include "core/logging.h"
#include "core/scoped_ptr.h"
#include "core/shared_ptr.h"
#include <kdsingleapplication.h>
#ifdef HAVE_QTSPARKLE
@@ -109,6 +113,8 @@
# include "osd/osdbase.h"
#endif
using std::make_shared;
int main(int argc, char *argv[]) {
#ifdef Q_OS_MACOS
@@ -270,7 +276,7 @@ int main(int argc, char *argv[]) {
const QString language = override_language.isEmpty() ? system_language : override_language;
std::unique_ptr<Translations> translations(new Translations);
ScopedPtr<Translations> translations(new Translations);
# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
translations->LoadTranslation("qt", QLibraryInfo::path(QLibraryInfo::TranslationsPath), language);
@@ -294,7 +300,7 @@ int main(int argc, char *argv[]) {
QNetworkProxyFactory::setApplicationProxyFactory(NetworkProxyFactory::Instance());
// Create the tray icon and OSD
std::shared_ptr<SystemTrayIcon> tray_icon = std::make_shared<SystemTrayIcon>();
SharedPtr<SystemTrayIcon> tray_icon = make_shared<SystemTrayIcon>();
#if defined(Q_OS_MACOS)
OSDMac osd(tray_icon, &app);