Commit bd676c15a0d862ddf6d35636b5d673f13329b972

Authored by Scott Klum
1 parent 9f3a5152

Added some explation for the use of QUrl::fromUserInput

openbr/plugins/gallery/binary.cpp
@@ -286,6 +286,9 @@ class utGallery : public BinaryGallery @@ -286,6 +286,9 @@ class utGallery : public BinaryGallery
286 qFatal("Expected 16-byte ImageID, got: %d bytes.", imageID.size()); 286 qFatal("Expected 16-byte ImageID, got: %d bytes.", imageID.size());
287 287
288 const int32_t algorithmID = (t.isEmpty() || t.file.fte) ? 0 : t.file.get<int32_t>("AlgorithmID"); 288 const int32_t algorithmID = (t.isEmpty() || t.file.fte) ? 0 : t.file.get<int32_t>("AlgorithmID");
  289 +
  290 + // QUrl::fromUserInput provides some nice functionality in terms of completing URLs
  291 + // e.g. C:/test.jpg -> file://C:/test.jpg and google.com/image.jpg -> http://google.com/image.jpg
289 const QByteArray url = QUrl::fromUserInput(t.file.get<QString>("URL", t.file.name)).toEncoded(); 292 const QByteArray url = QUrl::fromUserInput(t.file.get<QString>("URL", t.file.name)).toEncoded();
290 293
291 int32_t x = 0, y = 0; 294 int32_t x = 0, y = 0;