Changeset 104600 in vbox
- Timestamp:
- May 13, 2024 2:26:05 PM (7 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.cpp
r104585 r104600 615 615 m_highlightedUrl.scheme() == "http") 616 616 pOpenInNewTabAction->setEnabled(false); 617 if (isImage(strLink)) 618 pOpenInNewTabAction->setEnabled(false); 617 619 } 618 620 else … … 667 669 { 668 670 QString strLink = source().resolved(strAnchor).toString(); 669 QFileInfo fInfo(strLink); 670 QMimeDatabase base; 671 QMimeType type = base.mimeTypeForFile(fInfo); 672 if (type.isValid() && type.inherits("image/png")) 671 if (isImage(strLink)) 673 672 { 674 673 loadImage(source().resolved(strAnchor)); … … 856 855 return; 857 856 QUrl url = pSender->data().toUrl(); 857 if (isImage(url.toString())) 858 { 859 loadImage(url); 860 return; 861 } 858 862 if (url.isValid()) 859 863 setSource(url); … … 1040 1044 } 1041 1045 1046 bool UIHelpViewer::isImage(const QString &strLink) 1047 { 1048 if (strLink.isEmpty()) 1049 return false; 1050 QFileInfo fInfo(strLink); 1051 QMimeDatabase base; 1052 QMimeType type = base.mimeTypeForFile(fInfo); 1053 if (type.isValid() && type.inherits("image/png")) 1054 return true; 1055 return false; 1056 } 1042 1057 1043 1058 #include "UIHelpViewer.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.h
r104576 r104600 143 143 void clearOverlay(); 144 144 void enableOverlay(); 145 bool isImage(const QString &strLink); 145 146 146 147 const QHelpEngine* m_pHelpEngine;
Note:
See TracChangeset
for help on using the changeset viewer.