Show custom icons for some "known" folders.
This commit is contained in:
parent
5724790013
commit
a6e629c3af
198
res/Icons.qrc
198
res/Icons.qrc
@ -1,102 +1,104 @@
|
||||
<!DOCTYPE RCC>
|
||||
<RCC version="1.0">
|
||||
<qresource>
|
||||
<file>MainIcon.ico</file>
|
||||
<file>MainIcon.png</file>
|
||||
<file>MainIcon2.png</file>
|
||||
<file>icons/add.png</file>
|
||||
<file>icons/accept.png</file>
|
||||
<file>icons/application_view_list.png</file>
|
||||
<file>icons/application_xp_terminal.png</file>
|
||||
<file>icons/arrow_down.png</file>
|
||||
<file>icons/arrow_up.png</file>
|
||||
<file>icons/arrow_refresh.png</file>
|
||||
<file>icons/bell.png</file>
|
||||
<file>icons/bin.png</file>
|
||||
<file>icons/bomb.png</file>
|
||||
<file>icons/bug.png</file>
|
||||
<file>icons/calendar.png</file>
|
||||
<file>icons/cancel.png</file>
|
||||
<file>icons/cd.png</file>
|
||||
<file>icons/cd_add.png</file>
|
||||
<file>icons/cd_burn.png</file>
|
||||
<file>icons/cd_delete.png</file>
|
||||
<file>icons/cd_edit.png</file>
|
||||
<file>icons/cd_go.png</file>
|
||||
<file>icons/clock_play.png</file>
|
||||
<file>icons/cog.png</file>
|
||||
<file>icons/comment.png</file>
|
||||
<file>icons/compress.png</file>
|
||||
<file>icons/computer.png</file>
|
||||
<file>icons/controller.png</file>
|
||||
<file>icons/control_pause_blue.png</file>
|
||||
<file>icons/control_play_blue.png</file>
|
||||
<file>icons/cross.png</file>
|
||||
<file>icons/date.png</file>
|
||||
<file>icons/delete.png</file>
|
||||
<file>icons/disk.png</file>
|
||||
<file>icons/door_out.png</file>
|
||||
<file>icons/door_in.png</file>
|
||||
<file>icons/drive.png</file>
|
||||
<file>icons/drive_cd.png</file>
|
||||
<file>icons/drive_disk.png</file>
|
||||
<file>icons/drive_link.png</file>
|
||||
<file>icons/drive_network.png</file>
|
||||
<file>icons/exclamation.png</file>
|
||||
<file>icons/error.png</file>
|
||||
<file>icons/error_big.png</file>
|
||||
<file>icons/feed.png</file>
|
||||
<file>icons/folder.png</file>
|
||||
<file>icons/folder_add.png</file>
|
||||
<file>icons/folder_go.png</file>
|
||||
<file>icons/folder_image.png</file>
|
||||
<file>icons/folder_explore.png</file>
|
||||
<file>icons/folder_page.png</file>
|
||||
<file>icons/font.png</file>
|
||||
<file>icons/group.png</file>
|
||||
<file>icons/house.png</file>
|
||||
<file>icons/hourglass.png</file>
|
||||
<file>icons/information.png</file>
|
||||
<file>icons/lightning.png</file>
|
||||
<file>icons/media_play.png</file>
|
||||
<file>icons/money_dollar.png</file>
|
||||
<file>icons/monitor.png</file>
|
||||
<file>icons/music.png</file>
|
||||
<file>icons/network.png</file>
|
||||
<file>icons/network_error.png</file>
|
||||
<file>icons/palette.png</file>
|
||||
<file>icons/package.png</file>
|
||||
<file>icons/page_white_cplusplus.png</file>
|
||||
<file>icons/page_white_add.png</file>
|
||||
<file>icons/page_white_cd.png</file>
|
||||
<file>icons/page_white_copy.png</file>
|
||||
<file>icons/paste_plain.png</file>
|
||||
<file>icons/photo.png</file>
|
||||
<file>icons/play.png</file>
|
||||
<file>icons/power_off.png</file>
|
||||
<file>icons/power_on.png</file>
|
||||
<file>icons/report.png</file>
|
||||
<file>icons/resultset_next.png</file>
|
||||
<file>icons/script.png</file>
|
||||
<file>icons/script_edit.png</file>
|
||||
<file>icons/server_error.png</file>
|
||||
<file>icons/shield_admin.png</file>
|
||||
<file>icons/shield_error.png</file>
|
||||
<file>icons/shield_exclamation.png</file>
|
||||
<file>icons/shield_green.png</file>
|
||||
<file>icons/sound.png</file>
|
||||
<file>icons/star.png</file>
|
||||
<file>icons/table_edit.png</file>
|
||||
<file>icons/tick.png</file>
|
||||
<file>icons/timeline_marker.png</file>
|
||||
<file>icons/transmit.png</file>
|
||||
<file>icons/transmit_blue.png</file>
|
||||
<file>icons/user.png</file>
|
||||
<file>icons/user_suit.png</file>
|
||||
<file>icons/user_comment.png</file>
|
||||
<file>icons/wma.png</file>
|
||||
<file>icons/world.png</file>
|
||||
<file>icons/wrench.png</file>
|
||||
<file>icons/zoom.png</file>
|
||||
</qresource>
|
||||
<file>MainIcon.ico</file>
|
||||
<file>MainIcon.png</file>
|
||||
<file>MainIcon2.png</file>
|
||||
<file>icons/add.png</file>
|
||||
<file>icons/accept.png</file>
|
||||
<file>icons/application_view_list.png</file>
|
||||
<file>icons/application_xp_terminal.png</file>
|
||||
<file>icons/arrow_down.png</file>
|
||||
<file>icons/arrow_up.png</file>
|
||||
<file>icons/arrow_refresh.png</file>
|
||||
<file>icons/bell.png</file>
|
||||
<file>icons/bin.png</file>
|
||||
<file>icons/bomb.png</file>
|
||||
<file>icons/bug.png</file>
|
||||
<file>icons/calendar.png</file>
|
||||
<file>icons/cancel.png</file>
|
||||
<file>icons/cd.png</file>
|
||||
<file>icons/cd_add.png</file>
|
||||
<file>icons/cd_burn.png</file>
|
||||
<file>icons/cd_delete.png</file>
|
||||
<file>icons/cd_edit.png</file>
|
||||
<file>icons/cd_go.png</file>
|
||||
<file>icons/clock_play.png</file>
|
||||
<file>icons/cog.png</file>
|
||||
<file>icons/comment.png</file>
|
||||
<file>icons/compress.png</file>
|
||||
<file>icons/computer.png</file>
|
||||
<file>icons/controller.png</file>
|
||||
<file>icons/control_pause_blue.png</file>
|
||||
<file>icons/control_play_blue.png</file>
|
||||
<file>icons/cross.png</file>
|
||||
<file>icons/date.png</file>
|
||||
<file>icons/delete.png</file>
|
||||
<file>icons/disk.png</file>
|
||||
<file>icons/door_out.png</file>
|
||||
<file>icons/door_in.png</file>
|
||||
<file>icons/drive.png</file>
|
||||
<file>icons/drive_cd.png</file>
|
||||
<file>icons/drive_disk.png</file>
|
||||
<file>icons/drive_link.png</file>
|
||||
<file>icons/drive_network.png</file>
|
||||
<file>icons/exclamation.png</file>
|
||||
<file>icons/error.png</file>
|
||||
<file>icons/error_big.png</file>
|
||||
<file>icons/feed.png</file>
|
||||
<file>icons/film.png</file>
|
||||
<file>icons/folder.png</file>
|
||||
<file>icons/folder_add.png</file>
|
||||
<file>icons/folder_go.png</file>
|
||||
<file>icons/folder_image.png</file>
|
||||
<file>icons/folder_explore.png</file>
|
||||
<file>icons/folder_page.png</file>
|
||||
<file>icons/font.png</file>
|
||||
<file>icons/group.png</file>
|
||||
<file>icons/house.png</file>
|
||||
<file>icons/hourglass.png</file>
|
||||
<file>icons/information.png</file>
|
||||
<file>icons/lightning.png</file>
|
||||
<file>icons/media_play.png</file>
|
||||
<file>icons/money_dollar.png</file>
|
||||
<file>icons/monitor.png</file>
|
||||
<file>icons/music.png</file>
|
||||
<file>icons/network.png</file>
|
||||
<file>icons/network_error.png</file>
|
||||
<file>icons/palette.png</file>
|
||||
<file>icons/package.png</file>
|
||||
<file>icons/page_white_cplusplus.png</file>
|
||||
<file>icons/page_white_add.png</file>
|
||||
<file>icons/page_white_cd.png</file>
|
||||
<file>icons/page_white_copy.png</file>
|
||||
<file>icons/paste_plain.png</file>
|
||||
<file>icons/photo.png</file>
|
||||
<file>icons/picture.png</file>
|
||||
<file>icons/play.png</file>
|
||||
<file>icons/power_off.png</file>
|
||||
<file>icons/power_on.png</file>
|
||||
<file>icons/report.png</file>
|
||||
<file>icons/resultset_next.png</file>
|
||||
<file>icons/script.png</file>
|
||||
<file>icons/script_edit.png</file>
|
||||
<file>icons/server_error.png</file>
|
||||
<file>icons/shield_admin.png</file>
|
||||
<file>icons/shield_error.png</file>
|
||||
<file>icons/shield_exclamation.png</file>
|
||||
<file>icons/shield_green.png</file>
|
||||
<file>icons/sound.png</file>
|
||||
<file>icons/star.png</file>
|
||||
<file>icons/table_edit.png</file>
|
||||
<file>icons/tick.png</file>
|
||||
<file>icons/timeline_marker.png</file>
|
||||
<file>icons/transmit.png</file>
|
||||
<file>icons/transmit_blue.png</file>
|
||||
<file>icons/user.png</file>
|
||||
<file>icons/user_suit.png</file>
|
||||
<file>icons/user_comment.png</file>
|
||||
<file>icons/wma.png</file>
|
||||
<file>icons/world.png</file>
|
||||
<file>icons/wrench.png</file>
|
||||
<file>icons/zoom.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -30,7 +30,7 @@
|
||||
#define VER_LAMEXP_MINOR_LO 2
|
||||
#define VER_LAMEXP_TYPE Beta
|
||||
#define VER_LAMEXP_PATCH 7
|
||||
#define VER_LAMEXP_BUILD 566
|
||||
#define VER_LAMEXP_BUILD 567
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Tools versions
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include <QApplication>
|
||||
#include <QFileIconProvider>
|
||||
#include <QDesktopServices>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Dummy QFileIconProvider class
|
||||
@ -43,9 +44,19 @@ private:
|
||||
const QIcon m_networkIcon;
|
||||
const QIcon m_floppyIcon;
|
||||
const QIcon m_folderIcon;
|
||||
const QIcon m_homeIcon;
|
||||
const QIcon m_desktopIcon;
|
||||
const QIcon m_musicIcon;
|
||||
const QIcon m_moviesIcon;
|
||||
const QIcon m_picturesIcon;
|
||||
const QIcon m_emptyIcon;
|
||||
const QString m_folderType;
|
||||
const QString m_emptyType;
|
||||
const QString m_homeDir;
|
||||
const QString m_desktopDir;
|
||||
const QString m_musicDir;
|
||||
const QString m_moviesDir;
|
||||
const QString m_picturesDir;
|
||||
};
|
||||
|
||||
QFileIconProviderEx::QFileIconProviderEx()
|
||||
@ -55,6 +66,16 @@ QFileIconProviderEx::QFileIconProviderEx()
|
||||
m_cdromIcon(":/icons/drive_cd.png"),
|
||||
m_networkIcon(":/icons/drive_link.png"),
|
||||
m_floppyIcon(":/icons/drive_disk.png"),
|
||||
m_homeIcon(":/icons/house.png"),
|
||||
m_desktopIcon(":/icons/monitor.png"),
|
||||
m_musicIcon(":/icons/music.png"),
|
||||
m_moviesIcon(":/icons/film.png"),
|
||||
m_picturesIcon(":/icons/picture.png"),
|
||||
m_homeDir(QDir::fromNativeSeparators(QDesktopServices::storageLocation(QDesktopServices::HomeLocation))),
|
||||
m_desktopDir(QDir::fromNativeSeparators(QDesktopServices::storageLocation(QDesktopServices::DesktopLocation))),
|
||||
m_musicDir(QDir::fromNativeSeparators(QDesktopServices::storageLocation(QDesktopServices::MusicLocation))),
|
||||
m_moviesDir(QDir::fromNativeSeparators(QDesktopServices::storageLocation(QDesktopServices::MoviesLocation))),
|
||||
m_picturesDir(QDir::fromNativeSeparators(QDesktopServices::storageLocation(QDesktopServices::PicturesLocation))),
|
||||
m_folderType("Folder")
|
||||
{
|
||||
/* Nothing to do! */
|
||||
@ -62,7 +83,11 @@ QFileIconProviderEx::QFileIconProviderEx()
|
||||
|
||||
QIcon QFileIconProviderEx::icon(const QFileInfo &info) const
|
||||
{
|
||||
if(info.isRoot())
|
||||
if(info.isFile())
|
||||
{
|
||||
return m_emptyIcon;
|
||||
}
|
||||
else if(info.isRoot())
|
||||
{
|
||||
switch(GetDriveType(QWCHAR(QDir::toNativeSeparators(info.absoluteFilePath()))))
|
||||
{
|
||||
@ -80,8 +105,30 @@ QIcon QFileIconProviderEx::icon(const QFileInfo &info) const
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return info.isFile() ? m_emptyIcon : m_folderIcon;
|
||||
else if(!info.filePath().compare(m_homeDir, Qt::CaseInsensitive))
|
||||
{
|
||||
return m_homeIcon;
|
||||
}
|
||||
else if(!info.filePath().compare(m_desktopDir, Qt::CaseInsensitive))
|
||||
{
|
||||
return m_desktopIcon;
|
||||
}
|
||||
else if(!info.filePath().compare(m_musicDir, Qt::CaseInsensitive))
|
||||
{
|
||||
return m_musicIcon;
|
||||
}
|
||||
else if(!info.filePath().compare(m_moviesDir, Qt::CaseInsensitive))
|
||||
{
|
||||
return m_moviesIcon;
|
||||
}
|
||||
else if(!info.filePath().compare(m_picturesDir, Qt::CaseInsensitive))
|
||||
{
|
||||
return m_picturesIcon;
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_folderIcon;
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user