forked from platformio/platformio-core
Filter duplicated recent projects on Windows
This commit is contained in:
@ -64,9 +64,13 @@ class AppRPC:
|
||||
storage["projectsDir"] = storage["coreSettings"]["projects_dir"]["value"]
|
||||
|
||||
# skip non-existing recent projects
|
||||
storage["recentProjects"] = [
|
||||
p for p in storage.get("recentProjects", []) if is_platformio_project(p)
|
||||
]
|
||||
storage["recentProjects"] = list(
|
||||
set(
|
||||
os.path.normpath(p)
|
||||
for p in storage.get("recentProjects", [])
|
||||
if is_platformio_project(p)
|
||||
)
|
||||
)
|
||||
|
||||
state["storage"] = storage
|
||||
state.modified = False # skip saving extra fields
|
||||
|
@ -12,6 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import os
|
||||
import time
|
||||
|
||||
from ajsonrpc.core import JSONRPC20DispatchException
|
||||
@ -51,6 +52,8 @@ class IDERPC:
|
||||
def on_command_result(self, cmd_id, value):
|
||||
if cmd_id not in self._cmd_queue:
|
||||
return
|
||||
if self._cmd_queue[cmd_id]["method"] == "get_pio_project_dirs":
|
||||
value = [os.path.normpath(p) for p in value]
|
||||
self._cmd_queue[cmd_id]["future"].set_result(value)
|
||||
del self._cmd_queue[cmd_id]
|
||||
|
||||
|
Reference in New Issue
Block a user