Skip to content

Commit

Permalink
[FEATURE] Add support for Windows jump lists (#4161)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Feb 19, 2017
1 parent 801184a commit 0ad804a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ int main( int argc, char *argv[] )

myApp.setWindowIcon( QIcon( QgsApplication::appIconPath() ) );


//
// Set up the QSettings environment must be done after qapp is created
QCoreApplication::setOrganizationName( QgsApplication::QGIS_ORGANIZATION_NAME );
Expand Down
22 changes: 22 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@
#include <QWinTaskbarProgress>
#endif

#ifdef Q_OS_WIN
#include <QtWinExtras/QWinJumpList>
#include <QtWinExtras/QWinJumpListItem>
#include <QtWinExtras/QWinJumpListCategory>
#endif


//
// Mac OS X Includes
// Must include before GEOS 3 due to unqualified use of 'Point'
Expand Down Expand Up @@ -3327,6 +3334,21 @@ void QgisApp::updateRecentProjectPaths()

if ( mWelcomePage )
mWelcomePage->setRecentProjects( mRecentProjects );

#if defined(Q_OS_WIN)
QWinJumpList jumplist;
jumplist.recent()->clear();
Q_FOREACH ( const QgsWelcomePageItemsModel::RecentProjectData& recentProject, mRecentProjects )
{
QString name = recentProject.title != recentProject.path ? recentProject.title : QFileInfo( recentProject.path ).baseName();
QWinJumpListItem *newProject = new QWinJumpListItem( QWinJumpListItem::Link );
newProject->setTitle( name );
newProject->setFilePath( QDir::toNativeSeparators( QCoreApplication::applicationFilePath() ) );
newProject->setArguments( QStringList( recentProject.path ) );
jumplist.recent()->addItem( newProject );
}
#endif

} // QgisApp::updateRecentProjectPaths

// add this file to the recently opened/saved projects list
Expand Down

0 comments on commit 0ad804a

Please sign in to comment.