Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add support for Windows jump lists #4161

Merged
merged 1 commit into from
Feb 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/main.cpp
Expand Up @@ -803,6 +803,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
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