1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00

Replace QUrl with QString to fix autostart

This commit is contained in:
Elias 2019-08-03 14:56:40 +02:00
parent 17729a590f
commit f3e908826c
2 changed files with 10 additions and 6 deletions

View File

@ -15,11 +15,11 @@ ScreenPlayManager::ScreenPlayManager(const shared_ptr<InstalledListModel>& ilm,
, m_profileListModel { plm }
, m_qGuiApplication { static_cast<QGuiApplication*>(QGuiApplication::instance()) }
{
// loadActiveProfiles();
loadActiveProfiles();
}
void ScreenPlayManager::createWallpaper(
const int monitorIndex, const QUrl& absoluteStoragePath,
const int monitorIndex, const QString& absoluteStoragePath,
const QString& previewImage, const float volume,
const QString& fillMode, const QString& type)
{
@ -28,12 +28,16 @@ void ScreenPlayManager::createWallpaper(
m_settings->increaseActiveWallpaperCounter();
QString path = absoluteStoragePath;
if(absoluteStoragePath.contains("file:///"))
path = path.remove("file:///");
m_screenPlayWallpapers.emplace_back(
make_unique<ScreenPlayWallpaper>(
vector<int> { monitorIndex },
m_settings,
generateID(),
absoluteStoragePath.toLocalFile(),
path,
previewImage,
volume,
fillMode,
@ -41,9 +45,9 @@ void ScreenPlayManager::createWallpaper(
this));
m_monitorListModel->setWallpaperActiveMonitor(m_qGuiApplication->screens().at(monitorIndex),
QString { absoluteStoragePath.toLocalFile() + "/" + previewImage });
QString { path + "/" + previewImage });
m_settings->saveWallpaperToConfig(monitorIndex, absoluteStoragePath, type);
m_settings->saveWallpaperToConfig(monitorIndex, path, type);
}
void ScreenPlayManager::createWidget(QUrl absoluteStoragePath, const QString& previewImage)

View File

@ -53,7 +53,7 @@ signals:
void projectSettingsListModelNotFound();
public slots:
void createWallpaper(const int monitorIndex, const QUrl &absoluteStoragePath,
void createWallpaper(const int monitorIndex, const QString& absoluteStoragePath,
const QString& previewImage, const float volume,
const QString& fillMode, const QString& type);
void createWidget(QUrl absoluteStoragePath, const QString& previewImage);