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"]
|
storage["projectsDir"] = storage["coreSettings"]["projects_dir"]["value"]
|
||||||
|
|
||||||
# skip non-existing recent projects
|
# skip non-existing recent projects
|
||||||
storage["recentProjects"] = [
|
storage["recentProjects"] = list(
|
||||||
p for p in storage.get("recentProjects", []) if is_platformio_project(p)
|
set(
|
||||||
]
|
os.path.normpath(p)
|
||||||
|
for p in storage.get("recentProjects", [])
|
||||||
|
if is_platformio_project(p)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
state["storage"] = storage
|
state["storage"] = storage
|
||||||
state.modified = False # skip saving extra fields
|
state.modified = False # skip saving extra fields
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
import os
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from ajsonrpc.core import JSONRPC20DispatchException
|
from ajsonrpc.core import JSONRPC20DispatchException
|
||||||
@ -51,6 +52,8 @@ class IDERPC:
|
|||||||
def on_command_result(self, cmd_id, value):
|
def on_command_result(self, cmd_id, value):
|
||||||
if cmd_id not in self._cmd_queue:
|
if cmd_id not in self._cmd_queue:
|
||||||
return
|
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)
|
self._cmd_queue[cmd_id]["future"].set_result(value)
|
||||||
del self._cmd_queue[cmd_id]
|
del self._cmd_queue[cmd_id]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user