Skip to content

Commit

Permalink
Log errno when failing to set file mod time on unix
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Jul 29, 2018
1 parent 04009ce commit fba64bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions gui/src/helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@ void showInGraphicalShell(const QString &pathIn)
param += QDir::toNativeSeparators(pathIn);
QProcess::startDetached("explorer.exe "+param);
#elif defined(Q_OS_MAC)
// Q_UNUSED(parent)
QStringList scriptArgs;
scriptArgs << QLatin1String("-e") << QString::fromLatin1("tell application \"Finder\" to reveal POSIX file \"%1\"").arg(pathIn);
QProcess::execute(QLatin1String("/usr/bin/osascript"), scriptArgs);
scriptArgs.clear();
scriptArgs << QLatin1String("-e") << QLatin1String("tell application \"Finder\" to activate");
QProcess::execute("/usr/bin/osascript", scriptArgs);
#else
QDesktopServices::openUrl(QUrl("file:///"+pathIn));
QDesktopServices::openUrl(QUrl("file:///" + pathIn));
#endif
}

Expand Down
3 changes: 2 additions & 1 deletion lib/src/functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#ifdef Q_OS_WIN
#include <Windows.h>
#else
#include <errno.h>
#include <utime.h>
#endif
#ifdef QT_DEBUG
Expand Down Expand Up @@ -358,7 +359,7 @@ bool setFileCreationDate(const QString &path, const QDateTime &datetime)
const char *filename = path.toStdString().c_str();
if ((utime(filename, &timebuffer)) < 0)
{
// log(QStringLiteral("Unable to change the file creation date (%1): %2").arg(errno).arg(path), Logger::Error);
log(QStringLiteral("Unable to change the file creation date (%1): %2").arg(errno).arg(path), Logger::Error);
return false;
}
#endif
Expand Down

0 comments on commit fba64bb

Please sign in to comment.