@@ -145,27 +145,29 @@ def copy_to_clipboard(
145
145
self .log (message = f"Text copied: { Path (self .uri ).name } " , log_level = 4 )
146
146
return Path (self .uri ).name
147
147
if expected_format .lower () == "path" :
148
- QApplication .clipboard ().setText (str ( Path ( self .uri ). resolve ()) )
149
- self .log (message = f"Text copied: { Path ( self .uri ). resolve () } " , log_level = 4 )
150
- return Path ( self .uri ). resolve ()
151
- if expected_format .lower () == "getThemeIcon " :
148
+ QApplication .clipboard ().setText (self .uri )
149
+ self .log (message = f"Text copied: { self .uri } " , log_level = 4 )
150
+ return self .uri
151
+ if expected_format .lower () == "getthemeicon " :
152
152
QApplication .clipboard ().setText (
153
- f"QgsApplication.getThemeIcon('{ self .uri } ')"
153
+ f"QgsApplication.getThemeIcon('{ Path ( self .uri ). name } ')"
154
154
)
155
155
self .log (
156
- message = f"Text copied: QgsApplication.getThemeIcon('{ self .uri } ')" ,
156
+ message = f"Text copied: QgsApplication.getThemeIcon('{ Path ( self .uri ). name } ')" ,
157
157
log_level = 4 ,
158
158
)
159
159
return f"QgsApplication.getThemeIcon('{ self .uri } ')"
160
160
if expected_format .lower () == "qpixmap" :
161
- QApplication .clipboard ().setText (f"QIcon ('{ self .uri } ')" )
162
- self .log (message = f"Text copied: QIcon ('{ self .uri } ')" , log_level = 4 )
163
- return f"QIcon ('{ self .uri } ')"
161
+ QApplication .clipboard ().setText (f"QPixmap ('{ self .uri } ')" )
162
+ self .log (message = f"Text copied: QPixmap ('{ self .uri } ')" , log_level = 4 )
163
+ return f"QPixmap ('{ self .uri } ')"
164
164
if expected_format .lower () == "qicon" :
165
165
QApplication .clipboard ().setText (f"QIcon('{ self .uri } ')" )
166
166
self .log (message = f"Text copied: QIcon('{ self .uri } ')" , log_level = 4 )
167
167
return f"QIcon('{ self .uri } ')"
168
168
169
+ self .log (message = f"Undefined format: { expected_format } " , push = True , log_level = 1 )
170
+
169
171
170
172
class ResourceBrowser (QWidget ):
171
173
"""
0 commit comments