Skip to content
Permalink
Browse files

[FEATURE] Add support for Windows jump lists (#4161)

  • Loading branch information
NathanW2 committed Feb 19, 2017
1 parent 801184a commit 0ad804a7819fd570b9b1d4ff37fd87811d9086eb
Showing with 23 additions and 0 deletions.
  1. +1 −0 src/app/main.cpp
  2. +22 −0 src/app/qgisapp.cpp
@@ -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 );
@@ -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'
@@ -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

0 comments on commit 0ad804a

Please sign in to comment.
You can’t perform that action at this time.