diff --git a/earth_wallpaper/systemtray.py b/earth_wallpaper/systemtray.py index 9c6b422..7c9676d 100644 --- a/earth_wallpaper/systemtray.py +++ b/earth_wallpaper/systemtray.py @@ -86,13 +86,13 @@ def save_current_img(): picture_dir = QStandardPaths.writableLocation(QStandardPaths.PicturesLocation) + "/earth-wallpaper" if not QDir(picture_dir).exists(): QDir(picture_dir).mkpath(picture_dir) - source = QFile(os.path.join(img_dir, files[0])) + source = QFile(os.path.join(img_dir, files[-1])) - target = QFile(os.path.join(picture_dir, files[0])) + target = QFile(os.path.join(picture_dir, files[-1])) message = QMessageBox() if not target.exists(): if source.copy(target.fileName()): - logger.info(f"保存{os.path.join(img_dir, files[0])}到{os.path.join(picture_dir, files[0])}") + logger.info(f"保存{os.path.join(img_dir, files[-1])}到{os.path.join(picture_dir, files[-1])}") QMessageBox.information(message, "保存", "保存成功,已保存到用户Picture目录", QMessageBox.Yes) else: logger.warning("保存失败,原因未知") diff --git a/earth_wallpaper/utils/platformInfo.py b/earth_wallpaper/utils/platformInfo.py index c2eb0ca..6555627 100644 --- a/earth_wallpaper/utils/platformInfo.py +++ b/earth_wallpaper/utils/platformInfo.py @@ -35,8 +35,10 @@ def log_path() -> str: def check(self): if os.path.exists(self.download_dir()): - shutil.rmtree(self.download_dir()) - os.makedirs(self.download_dir()) + pass + # shutil.rmtree(self.download_dir()) + else: + os.makedirs(self.download_dir()) def get_os(self): return self.sys