Commit 88bceb16 authored by Robby Stephenson's avatar Robby Stephenson
Browse files

more imagejobtest debug++

parent 224fe0c4
Pipeline #165924 failed with stage
in 3 minutes and 54 seconds
......@@ -66,12 +66,12 @@ void ImageJob::slotStart() {
emitResult();
} else if(m_url.isLocalFile()) {
const QString fileName = m_url.toLocalFile();
myDebug() << "ImageJob:trying to read:" << fileName << "(" << m_url << ")";
myDebug() << "ImageJob:trying to read:" << fileName;;
if(!QFileInfo(fileName).isReadable()) {
setError(KIO::ERR_CANNOT_OPEN_FOR_READING);
setErrorText(i18n("Tellico is unable to load the image - %1.", fileName));
} else {
myDebug() << "...permissions:" << QFileInfo(fileName).permissions();
myDebug() << "...readable permissions:" << QFileInfo(fileName).permissions();
m_image = Data::Image(fileName, m_id);
if(m_image.isNull()) {
setError(KIO::ERR_UNKNOWN);
......
......@@ -106,10 +106,12 @@ void ImageJobTest::testUnreadable() {
QTemporaryFile tmpFile;
QVERIFY(tmpFile.open());
QVERIFY(!tmpFile.fileName().isEmpty());
qDebug() << "Temp file name is" << tmpFile.fileName();
QVERIFY(tmpFile.setPermissions(QFileDevice::Permissions()));
qDebug() << "...permissions are" << tmpFile.permissions();
tmpFile.close();
QVERIFY(tmpFile.setPermissions(QFileDevice::WriteOwner));
qDebug() << tmpFile.permissions();
QVERIFY(!tmpFile.isReadable());
QVERIFY(!QFileInfo(tmpFile.fileName()).isReadable());
QUrl u = QUrl::fromLocalFile(tmpFile.fileName());
Tellico::ImageJob* job = new Tellico::ImageJob(u);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment