#include <QFileDialog>
#include <QUrl>
+#include <memory>
#include "clientsettings.h"
#include "icon.h"
return;
}
- _media.reset(new QMediaPlayer);
+ _media = std::make_unique<QMediaPlayer>();
_media->setMedia(QUrl::fromLocalFile(file));
}
{
if (_audioAvailable) {
if (!ui.filename->text().isEmpty()) {
- _audioPreview.reset(new QMediaPlayer);
+ _audioPreview = std::make_unique<QMediaPlayer>();
_audioPreview->setMedia(QUrl::fromLocalFile(ui.filename->text()));
_audioPreview->play();
}
#include <QFileInfo>
#include <QIcon>
#include <QStringList>
+#include <memory>
#include "abstractnotificationbackend.h"
#include "buffermodel.h"
setContextMenuActionProvider(new ContextMenuActionProvider(this));
setToolBarActionProvider(new ToolBarActionProvider(this));
- _mainWin.reset(new MainWin()); // TODO C++14: std::make_unique
+ _mainWin = std::make_unique<MainWin>();
setMainWidget(_mainWin.get());
connect(_mainWin.get(), SIGNAL(connectToCore(const QVariantMap &)), this, SIGNAL(connectToCore(const QVariantMap &)));
// Since we can't get notified when the system theme changes, this means that a restart may be required
// to apply a theme change... but you can't have everything, I guess.
if (!_dummyThemeDir) {
- _dummyThemeDir.reset(new QTemporaryDir{});
+ _dummyThemeDir = std::make_unique<QTemporaryDir>();
if (!_dummyThemeDir->isValid() || !QDir{_dummyThemeDir->path()}.mkpath("icons/quassel-icon-proxy/apps/32")) {
qWarning() << "Could not create temporary directory for proxying the system icon theme, using fallback";
QIcon::setThemeName(fallbackTheme);
throw ExitException{EXIT_FAILURE, tr("Could not load or upgrade client settings!")};
}
- _client.reset(new Client(std::unique_ptr<QtUi>(new QtUi()))); // TODO C++14: std::make_unique
+ _client = std::make_unique<Client>(std::make_unique<QtUi>());
// Init UI only after the event loop has started
// TODO Qt5: Make this a lambda