diff --git a/src/capture/workers/launcher/applauncherwidget.cpp b/src/capture/workers/launcher/applauncherwidget.cpp index c0345a2a..0aa32282 100644 --- a/src/capture/workers/launcher/applauncherwidget.cpp +++ b/src/capture/workers/launcher/applauncherwidget.cpp @@ -92,10 +92,11 @@ AppLauncherWidget::AppLauncherWidget(const QPixmap &p, QWidget *parent): void AppLauncherWidget::launch(const QModelIndex &index) { if (!QFileInfo(m_tempFile).isReadable()) { - m_tempFile = FileNameHandler().generateAbsolutePath("/tmp") + ".png"; + m_tempFile = FileNameHandler().generateAbsolutePath(QDir::tempPath()) + ".png"; bool ok = m_pixmap.save(m_tempFile); if (!ok) { - QMessageBox::about(this, tr("Error"), tr("Unable to write in") + "/tmp."); + QMessageBox::about(this, tr("Error"), tr("Unable to write in") + + QDir::tempPath()); return; } } diff --git a/src/utils/screengrabber.cpp b/src/utils/screengrabber.cpp index ceafaac9..d1a170cc 100644 --- a/src/utils/screengrabber.cpp +++ b/src/utils/screengrabber.cpp @@ -26,6 +26,7 @@ #ifdef Q_OS_LINUX #include #include +#include #endif ScreenGrabber::ScreenGrabber(QObject *parent) : QObject(parent) { @@ -41,7 +42,7 @@ QPixmap ScreenGrabber::grabEntireDesktop(bool &ok) { switch (m_info.windowManager()) { case m_info.GNOME: { // https://github.com/GNOME/gnome-shell/blob/695bfb96160033be55cfb5ac41c121998f98c328/data/org.gnome.Shell.Screenshot.xml - QString path = FileNameHandler().generateAbsolutePath("/tmp") + ".png"; + QString path = FileNameHandler().generateAbsolutePath(QDir::tempPath()) + ".png"; QDBusInterface gnomeInterface(QStringLiteral("org.gnome.Shell"), QStringLiteral("/org/gnome/Shell/Screenshot"), QStringLiteral("org.gnome.Shell.Screenshot"));