-
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4448 from opengisch/projects_preview
Recent projects preview image
- Loading branch information
Showing
11 changed files
with
231 additions
and
70 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/*************************************************************************** | ||
localfilesimageprovider.cpp - LocalFilesImageProvider | ||
--------------------- | ||
begin : 18.05.2022 | ||
copyright : (C) 2022 by Mathieu Pellerin | ||
email : mathieu at opengis dot ch | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include "projectsimageprovider.h" | ||
|
||
#include <QFileInfo> | ||
|
||
ProjectsImageProvider::ProjectsImageProvider() | ||
: QQuickImageProvider( Pixmap ) | ||
{ | ||
} | ||
|
||
QImage ProjectsImageProvider::requestImage( const QString &id, QSize *size, const QSize &requestedSize ) | ||
{ | ||
// the id is passed on as an encoded URL string which needs decoding | ||
const QString path = QUrl::fromPercentEncoding( id.toUtf8() ); | ||
const QString previewPath = QStringLiteral( "%1.jpg" ).arg( path ); | ||
return QFileInfo::exists( previewPath ) ? QImage( previewPath ) : QImage(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/*************************************************************************** | ||
projectsimageprovider.h - ProjectsImageProvider | ||
--------------------- | ||
begin : 15.07.2023 | ||
copyright : (C) 2023 by Mathieu Pellerin | ||
email : mathieu at opengis dot ch | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
#ifndef PROJECTSIMAGEPROVIDER_H | ||
#define PROJECTSIMAGEPROVIDER_H | ||
|
||
#include <QQuickImageProvider> | ||
|
||
class ProjectsImageProvider : public QQuickImageProvider | ||
{ | ||
public: | ||
explicit ProjectsImageProvider(); | ||
|
||
QQmlImageProviderBase::ImageType imageType() const override { return QQmlImageProviderBase::Image; } | ||
QImage requestImage( const QString &id, QSize *size, const QSize &requestedSize ) override; | ||
}; | ||
|
||
#endif // PROJECTSIMAGEPROVIDER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
21d5f8c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Ta-daaa, freshly created APKs are available: arm64-android
Other architectures