Changed location of Qt4 bookmarks folder on Mac OS X. Only display bookmarks
in "Bookmarks Menu" folder in menu.ver1_6_1
parent
5ddc754727
commit
46e9a05a84
|
@ -358,6 +358,7 @@ void CelestiaAppWindow::init(const QString& qConfigFileName,
|
|||
* of the data directory depends on the platform:
|
||||
*
|
||||
* Win32: %APPDATA%\Celestia
|
||||
* Mac OS X: $HOME/Library/Application Support/Celestia
|
||||
* Unix and Mac OS X: $HOME/.config/Celestia
|
||||
*/
|
||||
void CelestiaAppWindow::initAppDataDirectory()
|
||||
|
@ -379,8 +380,12 @@ void CelestiaAppWindow::initAppDataDirectory()
|
|||
}
|
||||
#else
|
||||
// UNIX or Mac OS X
|
||||
// TODO: Should Mac OS X bookmarks go into $HOME/Library/Preferences instead?
|
||||
#ifdef TARGET_OS_MAC
|
||||
QString appDataPath = QDir::home().filePath("Library/Application Support");
|
||||
#else
|
||||
QString appDataPath = QDir::home().filePath(".config");
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
if (appDataPath != "")
|
||||
|
|
|
@ -320,16 +320,16 @@ BookmarkTreeModel::data(const QModelIndex& index, int role) const
|
|||
return item->title();
|
||||
|
||||
case Qt::DecorationRole:
|
||||
if (index.column() == 0 &&
|
||||
item->type() == BookmarkItem::Folder)
|
||||
{
|
||||
return QApplication::style()->standardIcon(QStyle::SP_DirIcon);
|
||||
}
|
||||
else
|
||||
{
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
if (index.column() == 0 &&
|
||||
item->type() == BookmarkItem::Folder)
|
||||
{
|
||||
return QApplication::style()->standardIcon(QStyle::SP_DirIcon);
|
||||
}
|
||||
else
|
||||
{
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
|
@ -572,7 +572,13 @@ BookmarkManager::saveBookmarks(QIODevice* device)
|
|||
void
|
||||
BookmarkManager::populateBookmarkMenu(QMenu* menu)
|
||||
{
|
||||
appendBookmarkMenuItems(menu, m_root);
|
||||
// First child of the root should always contain bookmarks for
|
||||
// the main menu.
|
||||
BookmarkItem* bookmarksMenuFolder = m_root->child(0);
|
||||
Q_ASSERT(bookmarksMenuFolder != NULL);
|
||||
|
||||
if (bookmarksMenuFolder != NULL)
|
||||
appendBookmarkMenuItems(menu, bookmarksMenuFolder);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue