e6410bd2 by 柴进

清理无用代码

1 parent 8b46fb30
......@@ -1133,7 +1133,7 @@ class DragDropScrollArea(QScrollArea):
if mime_data.hasImage():
image = mime_data.imageData()
if isinstance(image, QImage) and not image.isNull():
self.parent_window.add_clipboard_image(image)
self.parent_window.add_clipboard_image(image.copy())
event.acceptProposedAction()
return
except Exception:
......@@ -1934,13 +1934,13 @@ class ImageGeneratorWindow(QMainWindow):
if raw_data and len(raw_data) > 0:
image = QImage()
if image.loadFromData(raw_data):
return image
return image.copy()
# 尝试 hasImage + imageData
if mime_data.hasImage():
image_data = mime_data.imageData()
if isinstance(image_data, QImage) and not image_data.isNull():
return image_data
return image_data.copy()
except Exception as e:
self.logger.warning(f"MIME data 方式获取剪贴板图像失败: {e}")
......@@ -1971,7 +1971,7 @@ class ImageGeneratorWindow(QMainWindow):
if result.returncode == 0 and temp_path.exists() and temp_path.stat().st_size > 0:
image = QImage(str(temp_path))
if not image.isNull():
return image
return image.copy()
except Exception as e:
self.logger.warning(f"osascript 方式获取剪贴板图像失败: {e}")
......@@ -1979,7 +1979,7 @@ class ImageGeneratorWindow(QMainWindow):
try:
image = clipboard.image()
if image and not image.isNull():
return image
return image.copy()
except Exception as e:
self.logger.warning(f"clipboard.image() 失败: {e}")
......