|
|
@ -215,9 +215,12 @@ class Screenshot: public Command { |
|
|
|
throw DirectoryCannotBeCreated(target); |
|
|
|
throw DirectoryCannotBeCreated(target); |
|
|
|
QCoreApplication::processEvents(); |
|
|
|
QCoreApplication::processEvents(); |
|
|
|
QString filename(target+QDir::separator()+ |
|
|
|
QString filename(target+QDir::separator()+ |
|
|
|
QString("%1-%2-%3.html") |
|
|
|
QString("%4-%1-%2-%3.html") |
|
|
|
.arg(base) |
|
|
|
.arg(base) |
|
|
|
.arg(line, 4, 10, QChar('0')).arg(name)); |
|
|
|
.arg(line, 4, 10, QChar('0')) |
|
|
|
|
|
|
|
.arg(name) |
|
|
|
|
|
|
|
.arg(QDateTime::currentDateTime() |
|
|
|
|
|
|
|
.toString("yyyyMMddHHmmss"))); |
|
|
|
QFile file(filename); |
|
|
|
QFile file(filename); |
|
|
|
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) |
|
|
|
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) |
|
|
|
throw CannotWriteSouceHTML(filename); |
|
|
|
throw CannotWriteSouceHTML(filename); |
|
|
@ -240,9 +243,12 @@ class Screenshot: public Command { |
|
|
|
throw DirectoryCannotBeCreated(target); |
|
|
|
throw DirectoryCannotBeCreated(target); |
|
|
|
QCoreApplication::processEvents(); |
|
|
|
QCoreApplication::processEvents(); |
|
|
|
QString filename(target+QDir::separator()+ |
|
|
|
QString filename(target+QDir::separator()+ |
|
|
|
QString("%1-%2-%3.png") |
|
|
|
QString("%4-%1-%2-%3.png") |
|
|
|
.arg(base) |
|
|
|
.arg(base) |
|
|
|
.arg(line, 4, 10, QChar('0')).arg(name)); |
|
|
|
.arg(line, 4, 10, QChar('0')) |
|
|
|
|
|
|
|
.arg(name) |
|
|
|
|
|
|
|
.arg(QDateTime::currentDateTime() |
|
|
|
|
|
|
|
.toString("yyyyMMddHHmmss"))); |
|
|
|
if (!image.save(filename)) throw CannotWriteScreenshot(filename); |
|
|
|
if (!image.save(filename)) throw CannotWriteScreenshot(filename); |
|
|
|
return QDir(filename).absolutePath(); |
|
|
|
return QDir(filename).absolutePath(); |
|
|
|
} |
|
|
|
} |
|
|
|