diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2013-08-06 16:43:02 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-13 20:41:34 +0200 |
commit | 75a230610aa7f2548c0b7ef9cbacc3c5de58bccc (patch) | |
tree | c6a989861a3c98f28b530ff76f2f0dde1ec23624 /src | |
parent | a38a4318a0a6427e9a7f58aaf446ce0613924354 (diff) |
Rename QJumpList(Item) to QWinJumpList(Item)
Follow the existing QtWinExtras class naming convention.
All the other public classes are currently named QWinXxx.
Change-Id: I2509961e280b9794547e7420b941469fc8cdd2fa
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/imports/winextras/qquickjumplist.cpp | 20 | ||||
-rw-r--r-- | src/imports/winextras/qquickjumplist.h | 8 | ||||
-rw-r--r-- | src/winextras/doc/snippets/code/jumplist.cpp | 8 | ||||
-rw-r--r-- | src/winextras/doc/src/qtwinextras-overview.qdoc | 2 | ||||
-rw-r--r-- | src/winextras/qwinjumplist.cpp (renamed from src/winextras/qjumplist.cpp) | 170 | ||||
-rw-r--r-- | src/winextras/qwinjumplist.h (renamed from src/winextras/qjumplist.h) | 26 | ||||
-rw-r--r-- | src/winextras/qwinjumplistitem.cpp (renamed from src/winextras/qjumplistitem.cpp) | 94 | ||||
-rw-r--r-- | src/winextras/qwinjumplistitem.h (renamed from src/winextras/qjumplistitem.h) | 20 | ||||
-rw-r--r-- | src/winextras/winextras.pro | 8 |
9 files changed, 178 insertions, 178 deletions
diff --git a/src/imports/winextras/qquickjumplist.cpp b/src/imports/winextras/qquickjumplist.cpp index 45aa3e8..c328061 100644 --- a/src/imports/winextras/qquickjumplist.cpp +++ b/src/imports/winextras/qquickjumplist.cpp @@ -122,7 +122,7 @@ void QQuickJumpList::setShowRecentCategory(bool show) void QQuickJumpList::componentComplete() { QQuickItem::componentComplete(); - QJumpList jumplist; + QWinJumpList jumplist; jumplist.begin(); jumplist.setFrequentCategoryShown(frequentCategoryShown); jumplist.setRecentCategoryShown(recentCategoryShown); @@ -135,8 +135,8 @@ void QQuickJumpList::componentComplete() if (!categoryList.isEmpty()) { Q_FOREACH (QQuickJumpListCategory *category, categoryList) { jumplist.beginCategory(category->title()); - QList<QJumpListItem *> items = category->toItemList(); - Q_FOREACH (QJumpListItem *item, items) + QList<QWinJumpListItem *> items = category->toItemList(); + Q_FOREACH (QWinJumpListItem *item, items) jumplist.addItem(item); } } @@ -206,9 +206,9 @@ QString QQuickJumpListCategory::title() const return m_groupTitle; } -QList<QJumpListItem *> QQuickJumpListCategory::toItemList() const +QList<QWinJumpListItem *> QQuickJumpListCategory::toItemList() const { - QList<QJumpListItem *> destinations; + QList<QWinJumpListItem *> destinations; foreach (QQuickJumpListItem *item, m_destinations) destinations.append(item->toJumpListItem()); return destinations; @@ -239,19 +239,19 @@ int QQuickJumpListItem::type() const return m_type; } -QJumpListItem *QQuickJumpListItem::toJumpListItem() const +QWinJumpListItem *QQuickJumpListItem::toJumpListItem() const { - QJumpListItem *item = new QJumpListItem(); + QWinJumpListItem *item = new QWinJumpListItem(); switch (m_type) { case ItemTypeSeparator : - item->setType(QJumpListItem::Separator); + item->setType(QWinJumpListItem::Separator); break; case ItemTypeDestination : - item->setType(QJumpListItem::Destination); + item->setType(QWinJumpListItem::Destination); item->setFilePath(property("filePath").toString()); break; case ItemTypeLink : - item->setType(QJumpListItem::Link); + item->setType(QWinJumpListItem::Link); item->setFilePath(property("executablePath").toString()); item->setArguments(QStringList(property("arguments").toStringList())); item->setDescription(property("description").toString()); diff --git a/src/imports/winextras/qquickjumplist.h b/src/imports/winextras/qquickjumplist.h index ac9a6d5..d76d2ea 100644 --- a/src/imports/winextras/qquickjumplist.h +++ b/src/imports/winextras/qquickjumplist.h @@ -45,8 +45,8 @@ #include <QQuickItem> #include <QQmlListProperty> #include <QIcon> -#include <QJumpList> -#include <QJumpListItem> +#include <QWinJumpList> +#include <QWinJumpListItem> QT_BEGIN_NAMESPACE @@ -68,7 +68,7 @@ public: ~QQuickJumpListItem(); void setType(int type); int type() const; - QJumpListItem *toJumpListItem() const; + QWinJumpListItem *toJumpListItem() const; private: int m_type; // 1 - link, 2 - destination @@ -88,7 +88,7 @@ public: void setTitle(const QString &title); QString title() const; - QList<QJumpListItem *> toItemList() const; + QList<QWinJumpListItem *> toItemList() const; static void addItem(QQmlListProperty<QQuickJumpListItem> *property, QQuickJumpListItem *value); diff --git a/src/winextras/doc/snippets/code/jumplist.cpp b/src/winextras/doc/snippets/code/jumplist.cpp index e6dd75a..6e37920 100644 --- a/src/winextras/doc/snippets/code/jumplist.cpp +++ b/src/winextras/doc/snippets/code/jumplist.cpp @@ -38,18 +38,18 @@ ** ****************************************************************************/ -#include <QJumpList> +#include <QWinJumpList> void foo() { //! [jumplist] - QJumpList jumplist; + QWinJumpList jumplist; jumplist.begin(); - jumplist.setKnownCategoryShown(QJumpList::RecentCategory); + jumplist.setKnownCategoryShown(QWinJumpList::RecentCategory); jumplist.beginTasks(); - QJumpListItem *newProject = new QJumpListItem(QJumpListItem::Link); + QWinJumpListItem *newProject = new QWinJumpListItem(QWinJumpListItem::Link); newProject->setTitle(tr("Create new project")); newProject->setFilePath(QDir::toNativeSeparators(QCoreApplication::applicationFilePath())); newProject->setArguments(QStringList("--new-project")); diff --git a/src/winextras/doc/src/qtwinextras-overview.qdoc b/src/winextras/doc/src/qtwinextras-overview.qdoc index 6c33592..3ccb90a 100644 --- a/src/winextras/doc/src/qtwinextras-overview.qdoc +++ b/src/winextras/doc/src/qtwinextras-overview.qdoc @@ -119,7 +119,7 @@ \section3 Jump List Example The following example code illustrates how to use the classes in the - QJumpList and QJumpListItem classes to implement Jump Lists: + QWinJumpList and QWinJumpListItem classes to implement Jump Lists: \snippet code/jumplist.cpp jumplist diff --git a/src/winextras/qjumplist.cpp b/src/winextras/qwinjumplist.cpp index 14b7454..08ea544 100644 --- a/src/winextras/qjumplist.cpp +++ b/src/winextras/qwinjumplist.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qjumplist.h" -#include "qjumplistitem.h" +#include "qwinjumplist.h" +#include "qwinjumplistitem.h" #include <QDir> #include <QCoreApplication> @@ -55,9 +55,9 @@ QT_BEGIN_NAMESPACE /*! - \class QJumpList + \class QWinJumpList \inmodule QtWinExtras - \brief The QJumpList class represents a transparent wrapper around Windows + \brief The QWinJumpList class represents a transparent wrapper around Windows Jump Lists. \since 5.2 @@ -67,9 +67,9 @@ QT_BEGIN_NAMESPACE */ /*! - \enum QJumpListItem::Type + \enum QWinJumpListItem::Type - This enum specifies QJumpListItem type, changing its meaning for QJumpList. + This enum specifies QWinJumpListItem type, changing its meaning for QWinJumpList. \value Unknown Invalid item type. @@ -81,10 +81,10 @@ QT_BEGIN_NAMESPACE Item becomes a separator. This value is used only for task lists. */ -class QJumpListPrivate +class QWinJumpListPrivate { public: - QJumpListPrivate() : + QWinJumpListPrivate() : pDestList(0), isListBegan(false), showFrequentCategory(false), showRecentCategory(false), categoryBegan(false), tasksBegan(false), listSize(0) { @@ -93,7 +93,7 @@ public: static void warning(const char *function, HRESULT hresult) { const QString err = QWinExtras::errorStringFromHresult(hresult); - qWarning("QJumpList: %s() failed: %#010x, %s.", function, (unsigned)hresult, qPrintable(err)); + qWarning("QWinJumpList: %s() failed: %#010x, %s.", function, (unsigned)hresult, qPrintable(err)); } static QString iconsDirPath() @@ -142,9 +142,9 @@ public: jumpListItems.clear(); } - static QList<QJumpListItem *> fromComCollection(IObjectArray *array) + static QList<QWinJumpListItem *> fromComCollection(IObjectArray *array) { - QList<QJumpListItem *> list; + QList<QWinJumpListItem *> list; UINT count = 0; array->GetCount(&count); for (unsigned i = 0; i < count; i++) { @@ -154,7 +154,7 @@ public: continue; IShellItem2 *shellItem = 0; IShellLinkW *shellLink = 0; - QJumpListItem *jumplistItem = 0; + QWinJumpListItem *jumplistItem = 0; if (SUCCEEDED(collectionItem->QueryInterface(IID_IShellItem2, reinterpret_cast<void **>(shellItem)))) { jumplistItem = fromIShellItem(shellItem); shellItem->Release(); @@ -162,7 +162,7 @@ public: jumplistItem = fromIShellLink(shellLink); shellLink->Release(); } else { - qWarning("QJumpList: object of unexpected class found"); + qWarning("QWinJumpList: object of unexpected class found"); } collectionItem->Release(); if (jumplistItem) @@ -171,7 +171,7 @@ public: return list; } - static IObjectCollection *toComCollection(const QList<QJumpListItem *> &list) + static IObjectCollection *toComCollection(const QList<QWinJumpListItem *> &list) { if (list.isEmpty()) return 0; @@ -179,10 +179,10 @@ public: HRESULT hresult = CoCreateInstance(CLSID_EnumerableObjectCollection, 0, CLSCTX_INPROC_SERVER, IID_IObjectCollection, reinterpret_cast<void **>(&collection)); if (FAILED(hresult)) { const QString err = QWinExtras::errorStringFromHresult(hresult); - qWarning("QJumpList: failed to instantiate IObjectCollection: %#010x, %s.", (unsigned)hresult, qPrintable(err)); + qWarning("QWinJumpList: failed to instantiate IObjectCollection: %#010x, %s.", (unsigned)hresult, qPrintable(err)); return 0; } - Q_FOREACH (QJumpListItem *item, list) { + Q_FOREACH (QWinJumpListItem *item, list) { IUnknown *iitem = toICustomDestinationListItem(item); if (iitem) { collection->AddObject(iitem); @@ -192,9 +192,9 @@ public: return collection; } - static QJumpListItem *fromIShellLink(IShellLinkW *link) + static QWinJumpListItem *fromIShellLink(IShellLinkW *link) { - QJumpListItem *item = new QJumpListItem(QJumpListItem::Link); + QWinJumpListItem *item = new QWinJumpListItem(QWinJumpListItem::Link); IPropertyStore *linkProps; link->QueryInterface(IID_IPropertyStore, reinterpret_cast<void **>(&linkProps)); @@ -222,9 +222,9 @@ public: return item; } - static QJumpListItem *fromIShellItem(IShellItem2 *shellitem) + static QWinJumpListItem *fromIShellItem(IShellItem2 *shellitem) { - QJumpListItem *item = new QJumpListItem(QJumpListItem::Destination); + QWinJumpListItem *item = new QWinJumpListItem(QWinJumpListItem::Destination); wchar_t *strPtr; shellitem->GetDisplayName(SIGDN_FILESYSPATH, &strPtr); item->setFilePath(QString::fromWCharArray(strPtr)); @@ -255,31 +255,31 @@ public: return args; } - static IUnknown *toICustomDestinationListItem(const QJumpListItem *item) + static IUnknown *toICustomDestinationListItem(const QWinJumpListItem *item) { switch (item->type()) { - case QJumpListItem::Destination : + case QWinJumpListItem::Destination : return toIShellItem(item); - case QJumpListItem::Link : + case QWinJumpListItem::Link : return toIShellLink(item); - case QJumpListItem::Separator : + case QWinJumpListItem::Separator : return makeSeparatorShellItem(); default: return 0; } } - static IShellLinkW *toIShellLink(const QJumpListItem *item) + static IShellLinkW *toIShellLink(const QWinJumpListItem *item) { IShellLinkW *link = 0; HRESULT hresult = CoCreateInstance(CLSID_ShellLink, 0, CLSCTX_INPROC_SERVER, IID_IShellLinkW, reinterpret_cast<void **>(&link)); if (FAILED(hresult)) { const QString err = QWinExtras::errorStringFromHresult(hresult); - qWarning("QJumpList: failed to instantiate IShellLinkW: %#010x, %s.", (unsigned)hresult, qPrintable(err)); + qWarning("QWinJumpList: failed to instantiate IShellLinkW: %#010x, %s.", (unsigned)hresult, qPrintable(err)); return 0; } - const int iconPathSize = QJumpListPrivate::iconsDirPath().size() + sizeof(void *)*2 + 4; // path + ptr-name-in-hex + .ico + const int iconPathSize = QWinJumpListPrivate::iconsDirPath().size() + sizeof(void *)*2 + 4; // path + ptr-name-in-hex + .ico const int bufferSize = qMax(item->workingDirectory().size(), qMax(item->description().size(), qMax(item->title().size(), qMax(item->filePath().size(), iconPathSize)))) + 1; wchar_t *buffer = new wchar_t[bufferSize]; @@ -302,7 +302,7 @@ public: link->SetArguments(buffer); if (!item->icon().isNull()) { - QString iconPath = QJumpListPrivate::iconsDirPath() + QString::number(reinterpret_cast<quintptr>(item), 16) + QLatin1String(".ico"); + QString iconPath = QWinJumpListPrivate::iconsDirPath() + QString::number(reinterpret_cast<quintptr>(item), 16) + QLatin1String(".ico"); bool iconSaved = item->icon().pixmap(GetSystemMetrics(SM_CXICON)).save(iconPath, "ico"); if (iconSaved) { qt_qstringToNullTerminated(iconPath, buffer); @@ -329,7 +329,7 @@ public: return link; } - static IShellItem2 *toIShellItem(const QJumpListItem *item) + static IShellItem2 *toIShellItem(const QWinJumpListItem *item) { IShellItem2 *shellitem = 0; wchar_t *buffer = new wchar_t[item->filePath().length() + 1]; @@ -370,28 +370,28 @@ public: QString currentlyBuiltCategoryTitle; bool categoryBegan; bool tasksBegan; - QList<QJumpListItem *> jumpListItems; + QList<QWinJumpListItem *> jumpListItems; UINT listSize; }; /*! - Constructs a QJumpList with the parent object \a parent. + Constructs a QWinJumpList with the parent object \a parent. */ -QJumpList::QJumpList(QObject *parent) : - QObject(parent), d_ptr(new QJumpListPrivate) +QWinJumpList::QWinJumpList(QObject *parent) : + QObject(parent), d_ptr(new QWinJumpListPrivate) { HRESULT hresult = CoCreateInstance(CLSID_DestinationList, 0, CLSCTX_INPROC_SERVER, IID_ICustomDestinationList, reinterpret_cast<void **>(&d_ptr->pDestList)); if (FAILED(hresult)) - QJumpListPrivate::warning("CoCreateInstance", hresult); + QWinJumpListPrivate::warning("CoCreateInstance", hresult); } /*! - Destroys the QJumpList. If commit() or abort() were not called for the + Destroys the QWinJumpList. If commit() or abort() were not called for the corresponding begin() call, building the Jump List is aborted. */ -QJumpList::~QJumpList() +QWinJumpList::~QWinJumpList() { - Q_D(QJumpList); + Q_D(QWinJumpList); if (d->isListBegan) abort(); if (d->pDestList) @@ -403,9 +403,9 @@ QJumpList::~QJumpList() This method must be called before adding Jump List items. Returns true if successful; otherwise returns false. */ -bool QJumpList::begin() +bool QWinJumpList::begin() { - Q_D(QJumpList); + Q_D(QWinJumpList); if (!d->pDestList) return false; @@ -416,7 +416,7 @@ bool QJumpList::begin() array->Release(); d->isListBegan = true; } else { - QJumpListPrivate::warning("BeginList", hresult); + QWinJumpListPrivate::warning("BeginList", hresult); } return SUCCEEDED(hresult); } @@ -425,9 +425,9 @@ bool QJumpList::begin() Completes Jump List building, initiated by begin(), and displays it. Returns true if successful; otherwise returns false. */ -bool QJumpList::commit() +bool QWinJumpList::commit() { - Q_D(QJumpList); + Q_D(QWinJumpList); if (!d->pDestList || !d->isListBegan) return false; @@ -445,7 +445,7 @@ bool QJumpList::commit() d->clearItems(); HRESULT hresult = d->pDestList->CommitList(); if (FAILED(hresult)) - QJumpListPrivate::warning("CommitList", hresult); + QWinJumpListPrivate::warning("CommitList", hresult); return SUCCEEDED(hresult); } @@ -454,16 +454,16 @@ bool QJumpList::commit() active Jump List unchanged. Returns true if successful; otherwise returns false. */ -bool QJumpList::abort() +bool QWinJumpList::abort() { - Q_D(QJumpList); + Q_D(QWinJumpList); if (!d->pDestList) return false; d->clearItems(); HRESULT hresult = d->pDestList->AbortList(); if (FAILED(hresult)) - QJumpListPrivate::warning("AbortList", hresult); + QWinJumpListPrivate::warning("AbortList", hresult); return SUCCEEDED(hresult); } @@ -471,9 +471,9 @@ bool QJumpList::abort() Clears the application Jump List. Returns true if successful; otherwise returns false. */ -bool QJumpList::clear() +bool QWinJumpList::clear() { - Q_D(QJumpList); + Q_D(QWinJumpList); if (!d->pDestList) return false; @@ -493,9 +493,9 @@ bool QJumpList::clear() This method must be called before begin(). Returns true if successful; otherwise returns false. */ -bool QJumpList::setApplicationId(const QString &appId) +bool QWinJumpList::setApplicationId(const QString &appId) { - Q_D(QJumpList); + Q_D(QWinJumpList); if (!d->pDestList) return false; @@ -503,7 +503,7 @@ bool QJumpList::setApplicationId(const QString &appId) HRESULT hresult = d->pDestList->SetAppID(wcAppId); delete[] wcAppId; if (FAILED(hresult)) - QJumpListPrivate::warning("SetAppID", hresult); + QWinJumpListPrivate::warning("SetAppID", hresult); return SUCCEEDED(hresult); } @@ -512,12 +512,12 @@ bool QJumpList::setApplicationId(const QString &appId) again. Adding a group with removed destinations will fail. */ -QList<QJumpListItem *> QJumpList::removedDestinations() const +QList<QWinJumpListItem *> QWinJumpList::removedDestinations() const { - Q_D(const QJumpList); + Q_D(const QWinJumpList); IObjectArray *array = 0; d->pDestList->GetRemovedDestinations(IID_IObjectArray, reinterpret_cast<void **>(&array)); - QList<QJumpListItem *> list = QJumpListPrivate::fromComCollection(array); + QList<QWinJumpListItem *> list = QWinJumpListPrivate::fromComCollection(array); array->Release(); return list; } @@ -526,47 +526,47 @@ QList<QJumpListItem *> QJumpList::removedDestinations() const Returns the number of items that the Jump List will display. This is configured by the user. */ -int QJumpList::capacity() const +int QWinJumpList::capacity() const { - Q_D(const QJumpList); + Q_D(const QWinJumpList); return d->listSize; } /*! - \property QJumpList::isRecentCategoryShown + \property QWinJumpList::isRecentCategoryShown \brief whether to show the known Recent category The default value of this property is false. Changes to this property are applied only after commit() is called. */ -void QJumpList::setRecentCategoryShown(bool show) +void QWinJumpList::setRecentCategoryShown(bool show) { - Q_D(QJumpList); + Q_D(QWinJumpList); d->showRecentCategory = show; } -bool QJumpList::isRecentCategoryShown() const +bool QWinJumpList::isRecentCategoryShown() const { - Q_D(const QJumpList); + Q_D(const QWinJumpList); return d->showRecentCategory; } /*! - \property QJumpList::isFrequentCategoryShown + \property QWinJumpList::isFrequentCategoryShown \brief whether to show the known Frequent category The default value of this property is false. Changes to this property are applied only after commit() is called. */ -void QJumpList::setFrequentCategoryShown(bool show) +void QWinJumpList::setFrequentCategoryShown(bool show) { - Q_D(QJumpList); + Q_D(QWinJumpList); d->showFrequentCategory = show; } -bool QJumpList::isFrequentCategoryShown() const +bool QWinJumpList::isFrequentCategoryShown() const { - Q_D(const QJumpList); + Q_D(const QWinJumpList); return d->showFrequentCategory; } @@ -575,9 +575,9 @@ bool QJumpList::isFrequentCategoryShown() const begin() must be called before calling this method. */ -void QJumpList::beginCategory(const QString &title) +void QWinJumpList::beginCategory(const QString &title) { - Q_D(QJumpList); + Q_D(QWinJumpList); if (!d->pDestList) return; @@ -594,9 +594,9 @@ void QJumpList::beginCategory(const QString &title) begin() must be called before calling this method. */ -void QJumpList::beginTasks() +void QWinJumpList::beginTasks() { - Q_D(QJumpList); + Q_D(QWinJumpList); if (!d->pDestList) return; @@ -612,9 +612,9 @@ void QJumpList::beginTasks() beginCategory() or beginTasks() should be called before calling this method. Returns true if successful; otherwise returns false. */ -bool QJumpList::addItem(QJumpListItem *item) +bool QWinJumpList::addItem(QWinJumpListItem *item) { - Q_D(QJumpList); + Q_D(QWinJumpList); if (!d->pDestList || (!d->categoryBegan && !d->tasksBegan)) { return false; } @@ -628,13 +628,13 @@ bool QJumpList::addItem(QJumpListItem *item) beginCategory() or beginTasks() should be called before calling this method. */ -void QJumpList::addDestination(const QString &filePath) +void QWinJumpList::addDestination(const QString &filePath) { - Q_D(QJumpList); + Q_D(QWinJumpList); if (!d->pDestList || (!d->categoryBegan && !d->tasksBegan)) return; - QJumpListItem *item = new QJumpListItem(QJumpListItem::Destination); + QWinJumpListItem *item = new QWinJumpListItem(QWinJumpListItem::Destination); item->setFilePath(filePath); d->jumpListItems.append(item); } @@ -647,7 +647,7 @@ void QJumpList::addDestination(const QString &filePath) beginCategory() or beginTasks() should be called before calling this method. */ -void QJumpList::addLink(const QString &title, const QString &executablePath, const QStringList &arguments) +void QWinJumpList::addLink(const QString &title, const QString &executablePath, const QStringList &arguments) { addLink(QIcon(), title, QString(), QString(), executablePath, arguments); } @@ -660,7 +660,7 @@ void QJumpList::addLink(const QString &title, const QString &executablePath, con beginCategory() or beginTasks() should be called before calling this method. */ -void QJumpList::addLink(const QString &title, const QString &description, const QString &executablePath, const QStringList &arguments) +void QWinJumpList::addLink(const QString &title, const QString &description, const QString &executablePath, const QStringList &arguments) { addLink(QIcon(), title, description, QString(), executablePath, arguments); } @@ -673,7 +673,7 @@ void QJumpList::addLink(const QString &title, const QString &description, const beginCategory() or beginTasks() should be called before calling this method. */ -void QJumpList::addLink(const QIcon &icon, const QString &title, const QString &executablePath, const QStringList &arguments) +void QWinJumpList::addLink(const QIcon &icon, const QString &title, const QString &executablePath, const QStringList &arguments) { addLink(icon, title, QString(), QString(), executablePath, arguments); } @@ -686,7 +686,7 @@ void QJumpList::addLink(const QIcon &icon, const QString &title, const QString & beginCategory() or beginTasks() should be called before calling this method. */ -void QJumpList::addLink(const QIcon &icon, const QString &title, const QString &description, const QString &executablePath, const QStringList &arguments) +void QWinJumpList::addLink(const QIcon &icon, const QString &title, const QString &description, const QString &executablePath, const QStringList &arguments) { addLink(icon, title, description, QString(), executablePath, arguments); } @@ -697,13 +697,13 @@ void QJumpList::addLink(const QIcon &icon, const QString &title, const QString & beginCategory() or beginTasks() should be called before calling this method. */ -void QJumpList::addLink(const QIcon &icon, const QString &title, const QString &description, const QString &workingDirectory, const QString &executablePath, const QStringList &arguments) +void QWinJumpList::addLink(const QIcon &icon, const QString &title, const QString &description, const QString &workingDirectory, const QString &executablePath, const QStringList &arguments) { - Q_D(QJumpList); + Q_D(QWinJumpList); if (!d->pDestList || (!d->categoryBegan && !d->tasksBegan)) return; - QJumpListItem *item = new QJumpListItem(QJumpListItem::Link); + QWinJumpListItem *item = new QWinJumpListItem(QWinJumpListItem::Link); item->setFilePath(executablePath); item->setTitle(title); item->setArguments(arguments); @@ -718,13 +718,13 @@ void QJumpList::addLink(const QIcon &icon, const QString &title, const QString & beginTasks() should be called before calling this method. */ -void QJumpList::addSeparator() +void QWinJumpList::addSeparator() { - Q_D(QJumpList); + Q_D(QWinJumpList); if (!d->pDestList || (!d->categoryBegan && !d->tasksBegan)) return; - QJumpListItem *item = new QJumpListItem(QJumpListItem::Separator); + QWinJumpListItem *item = new QWinJumpListItem(QWinJumpListItem::Separator); d->jumpListItems.append(item); } diff --git a/src/winextras/qjumplist.h b/src/winextras/qwinjumplist.h index d2e1027..77a46fc 100644 --- a/src/winextras/qjumplist.h +++ b/src/winextras/qwinjumplist.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QJUMPLIST_H -#define QJUMPLIST_H +#ifndef QWINJUMPLIST_H +#define QWINJUMPLIST_H #include <QtCore/qobject.h> #include <QtCore/qstringlist.h> @@ -50,18 +50,18 @@ QT_BEGIN_NAMESPACE class QIcon; -class QJumpListItem; -class QJumpListPrivate; +class QWinJumpListItem; +class QWinJumpListPrivate; -class Q_WINEXTRAS_EXPORT QJumpList : public QObject +class Q_WINEXTRAS_EXPORT QWinJumpList : public QObject { Q_OBJECT Q_PROPERTY(int recentCategoryShown READ isRecentCategoryShown WRITE setRecentCategoryShown) Q_PROPERTY(int frequentCategoryShown READ isFrequentCategoryShown WRITE setFrequentCategoryShown) public: - explicit QJumpList(QObject *parent = 0); - ~QJumpList(); + explicit QWinJumpList(QObject *parent = 0); + ~QWinJumpList(); public Q_SLOTS: bool begin(); @@ -71,7 +71,7 @@ public Q_SLOTS: public: bool setApplicationId(const QString &); - QList<QJumpListItem *> removedDestinations() const; + QList<QWinJumpListItem *> removedDestinations() const; int capacity() const; void setRecentCategoryShown(bool); @@ -82,7 +82,7 @@ public: void beginCategory(const QString &title); void beginTasks(); - bool addItem(QJumpListItem *item); + bool addItem(QWinJumpListItem *item); void addDestination(const QString &filePath); void addLink(const QString &title, const QString &executablePath, const QStringList &arguments = QStringList()); void addLink(const QString &title, const QString &description, const QString &executablePath, const QStringList &arguments = QStringList()); @@ -92,11 +92,11 @@ public: void addSeparator(); private: - Q_DISABLE_COPY(QJumpList) - Q_DECLARE_PRIVATE(QJumpList) - QScopedPointer<QJumpListPrivate> d_ptr; + Q_DISABLE_COPY(QWinJumpList) + Q_DECLARE_PRIVATE(QWinJumpList) + QScopedPointer<QWinJumpListPrivate> d_ptr; }; QT_END_NAMESPACE -#endif // QJUMPLIST_H +#endif // QWINJUMPLIST_H diff --git a/src/winextras/qjumplistitem.cpp b/src/winextras/qwinjumplistitem.cpp index 2c96b79..a73aa99 100644 --- a/src/winextras/qjumplistitem.cpp +++ b/src/winextras/qwinjumplistitem.cpp @@ -39,22 +39,22 @@ ** ****************************************************************************/ -#include "qjumplistitem.h" +#include "qwinjumplistitem.h" QT_BEGIN_NAMESPACE /*! - \class QJumpListItem + \class QWinJumpListItem \inmodule QtWinExtras \since 5.2 - \inheaderfile QJumpList - \brief The QJumpListItem class represents a Jump List destination or link. + \inheaderfile QWinJumpList + \brief The QWinJumpListItem class represents a Jump List destination or link. - Objects of this class are returned by QJumpList::removedDestinations() + Objects of this class are returned by QWinJumpList::removedDestinations() and can also be used to add items to a Jump List. */ -class QJumpListItemPrivate +class QWinJumpListItemPrivate { public: QString filePath; @@ -63,40 +63,40 @@ public: QString description; QIcon icon; QStringList arguments; - QJumpListItem::Type type; + QWinJumpListItem::Type type; }; /*! - Constructs a QJumpListItem with the specified \a type. + Constructs a QWinJumpListItem with the specified \a type. */ -QJumpListItem::QJumpListItem(QJumpListItem::Type type) : - d_ptr(new QJumpListItemPrivate) +QWinJumpListItem::QWinJumpListItem(QWinJumpListItem::Type type) : + d_ptr(new QWinJumpListItemPrivate) { d_ptr->type = type; } /*! - Destroys the QJumpListItem. + Destroys the QWinJumpListItem. */ -QJumpListItem::~QJumpListItem() +QWinJumpListItem::~QWinJumpListItem() { } /*! Sets the item \a type. */ -void QJumpListItem::setType(QJumpListItem::Type type) +void QWinJumpListItem::setType(QWinJumpListItem::Type type) { - Q_D(QJumpListItem); + Q_D(QWinJumpListItem); d->type = type; } /*! Returns the item type. */ -QJumpListItem::Type QJumpListItem::type() const +QWinJumpListItem::Type QWinJumpListItem::type() const { - Q_D(const QJumpListItem); + Q_D(const QWinJumpListItem); return d->type; } @@ -106,10 +106,10 @@ QJumpListItem::Type QJumpListItem::type() const \list - \li If the item type is QJumpListItem::Destination, \a filePath is the + \li If the item type is QWinJumpListItem::Destination, \a filePath is the path to a file that can be opened by an application. - \li If the item type is QJumpListItem::Link, \a filePath is the path to + \li If the item type is QWinJumpListItem::Link, \a filePath is the path to an executable that is executed when this item is clicked by the user. @@ -117,122 +117,122 @@ QJumpListItem::Type QJumpListItem::type() const \sa setWorkingDirectory(), setArguments() */ -void QJumpListItem::setFilePath(const QString &filePath) +void QWinJumpListItem::setFilePath(const QString &filePath) { - Q_D(QJumpListItem); + Q_D(QWinJumpListItem); d->filePath = filePath; } /*! Returns the file path set by setFilePath(). */ -QString QJumpListItem::filePath() const +QString QWinJumpListItem::filePath() const { - Q_D(const QJumpListItem); + Q_D(const QWinJumpListItem); return d->filePath; } /*! Sets the path to the working directory of this item to \a workingDirectory. - This value is used only if the type of this item is QJumpListItem::Link. + This value is used only if the type of this item is QWinJumpListItem::Link. \sa setFilePath() */ -void QJumpListItem::setWorkingDirectory(const QString &workingDirectory) +void QWinJumpListItem::setWorkingDirectory(const QString &workingDirectory) { - Q_D(QJumpListItem); + Q_D(QWinJumpListItem); d->workingDirectory = workingDirectory; } /*! Returns the working directory path. */ -QString QJumpListItem::workingDirectory() const +QString QWinJumpListItem::workingDirectory() const { - Q_D(const QJumpListItem); + Q_D(const QWinJumpListItem); return d->workingDirectory; } /*! Sets the \a icon of this item. - This value is used only if the type of this item is QJumpListItem::Link. + This value is used only if the type of this item is QWinJumpListItem::Link. */ -void QJumpListItem::setIcon(const QIcon &icon) +void QWinJumpListItem::setIcon(const QIcon &icon) { - Q_D(QJumpListItem); + Q_D(QWinJumpListItem); d->icon = icon; } /*! Returns the icon set for this item. */ -QIcon QJumpListItem::icon() const +QIcon QWinJumpListItem::icon() const { - Q_D(const QJumpListItem); + Q_D(const QWinJumpListItem); return d->icon; } /*! Sets the \a title of this item. - This value is used only if the type of this item is QJumpListItem::Link. + This value is used only if the type of this item is QWinJumpListItem::Link. */ -void QJumpListItem::setTitle(const QString &title) +void QWinJumpListItem::setTitle(const QString &title) { - Q_D(QJumpListItem); + Q_D(QWinJumpListItem); d->title = title; } /*! Returns the title of this item. */ -QString QJumpListItem::title() const +QString QWinJumpListItem::title() const { - Q_D(const QJumpListItem); + Q_D(const QWinJumpListItem); return d->title; } /*! Sets a \a description for this item. - This value is used only if the type of this item is QJumpListItem::Link. + This value is used only if the type of this item is QWinJumpListItem::Link. */ -void QJumpListItem::setDescription(const QString &description) +void QWinJumpListItem::setDescription(const QString &description) { - Q_D(QJumpListItem); + Q_D(QWinJumpListItem); d->description = description; } /*! Returns the description of this item. */ -QString QJumpListItem::description() const +QString QWinJumpListItem::description() const { - Q_D(const QJumpListItem); + Q_D(const QWinJumpListItem); return d->description; } /*! Sets command-line \a arguments for this item. - This value is used only if the type of this item is QJumpListItem::Link. + This value is used only if the type of this item is QWinJumpListItem::Link. \sa setFilePath() */ -void QJumpListItem::setArguments(const QStringList &arguments) +void QWinJumpListItem::setArguments(const QStringList &arguments) { - Q_D(QJumpListItem); + Q_D(QWinJumpListItem); d->arguments = arguments; } /*! Returns the command-line arguments of this item. */ -QStringList QJumpListItem::arguments() const +QStringList QWinJumpListItem::arguments() const { - Q_D(const QJumpListItem); + Q_D(const QWinJumpListItem); return d->arguments; } diff --git a/src/winextras/qjumplistitem.h b/src/winextras/qwinjumplistitem.h index a26729c..824cf8f 100644 --- a/src/winextras/qjumplistitem.h +++ b/src/winextras/qwinjumplistitem.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QJUMPLISTITEM_H -#define QJUMPLISTITEM_H +#ifndef QWINJUMPLISTITEM_H +#define QWINJUMPLISTITEM_H #include <QtGui/qicon.h> #include <QtCore/qobject.h> @@ -50,9 +50,9 @@ QT_BEGIN_NAMESPACE -class QJumpListItemPrivate; +class QWinJumpListItemPrivate; -class Q_WINEXTRAS_EXPORT QJumpListItem +class Q_WINEXTRAS_EXPORT QWinJumpListItem { public: enum Type { @@ -62,8 +62,8 @@ public: Separator }; - explicit QJumpListItem(Type type = Unknown); - ~QJumpListItem(); + explicit QWinJumpListItem(Type type = Unknown); + ~QWinJumpListItem(); void setType(Type type); Type type() const; @@ -81,11 +81,11 @@ public: QStringList arguments() const; private: - Q_DISABLE_COPY(QJumpListItem) - Q_DECLARE_PRIVATE(QJumpListItem) - QScopedPointer<QJumpListItemPrivate> d_ptr; + Q_DISABLE_COPY(QWinJumpListItem) + Q_DECLARE_PRIVATE(QWinJumpListItem) + QScopedPointer<QWinJumpListItemPrivate> d_ptr; }; QT_END_NAMESPACE -#endif // QJUMPLISTITEM_H +#endif // QWINJUMPLISTITEM_H diff --git a/src/winextras/winextras.pro b/src/winextras/winextras.pro index 74017c1..e278fff 100644 --- a/src/winextras/winextras.pro +++ b/src/winextras/winextras.pro @@ -7,8 +7,8 @@ SOURCES += \ qwinfunctions_p.cpp \ qwintaskbarbutton.cpp \ windowsguidsdefs.cpp \ - qjumplist.cpp \ - qjumplistitem.cpp \ + qwinjumplist.cpp \ + qwinjumplistitem.cpp \ qwineventfilter.cpp \ qwinthumbnailtoolbar.cpp \ qwinthumbnailtoolbutton.cpp \ @@ -20,8 +20,8 @@ HEADERS += \ qwinfunctions_p.h \ qwintaskbarbutton_p.h \ qwintaskbarbutton.h \ - qjumplist.h \ - qjumplistitem.h \ + qwinjumplist.h \ + qwinjumplistitem.h \ winshobjidl_p.h \ winpropkey_p.h \ qwineventfilter_p.h \ |