Skip to content

feat: support opening source files by clicking them on macOS#849

Merged
coder3101 merged 16 commits into
cpeditor:masterfrom
swiftqwq:register-as-file-open-method
Jun 4, 2021
Merged

feat: support opening source files by clicking them on macOS#849
coder3101 merged 16 commits into
cpeditor:masterfrom
swiftqwq:register-as-file-open-method

Conversation

@swiftqwq

@swiftqwq swiftqwq commented Jun 2, 2021

Copy link
Copy Markdown
Member

Description

Listen QFileOpenEvent to open files and register as an editor for code files on macOS.

Related Issues / Pull Requests

Closes #846

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate)

Untitled

Checklist

  • If the key of a setting is changed, the old attribute is updated or it is resolved in SettingsUpdater.
  • If there are changes of the text displayed in the UI, they are wrapped in tr() or QCoreApplication::translate().
  • If needed, I have opened a pull request or an issue to update the documentation.
  • If these changes are notable, they are documented in CHANGELOG.md.

Additional text

Comment thread src/application.hpp Outdated
Comment thread src/appwindow.hpp Outdated
Comment thread src/application.hpp
Comment thread src/application.cpp Outdated
Comment thread src/application.cpp Outdated
@coder3101

Copy link
Copy Markdown
Member

From QFileOpenEvent docs

Note: This class is currently supported for macOS only.

I expected some OS macros, how is it being handled in other OS?

@swiftqwq swiftqwq requested a review from sonulohani June 3, 2021 14:07
Comment thread src/application.hpp Outdated
sonulohani
sonulohani previously approved these changes Jun 4, 2021

@sonulohani sonulohani left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Wait for others also to review the code before merging it into master.

@ouuan ouuan changed the title Associate source files to open in cpeditor on macOS feat: support opening source files by clicking them on macOS Jun 4, 2021
ouuan added 4 commits June 4, 2021 21:11
ouuan
ouuan previously approved these changes Jun 4, 2021

@ouuan ouuan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it looks good to me. However, we still need someone to test it on macOS.

Comment thread src/application.cpp Outdated
@coder3101

Copy link
Copy Markdown
Member

Now it looks good to me. However, we still need someone to test it on macOS.

I will test and let you know.

@coder3101 coder3101 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works fine as well.

@coder3101 coder3101 merged commit db967e5 into cpeditor:master Jun 4, 2021
@swiftqwq swiftqwq deleted the register-as-file-open-method branch June 5, 2021 10:07
@swiftqwq

swiftqwq commented Jun 5, 2021

Copy link
Copy Markdown
Member Author

BTW, should we also do this for Windows (by editing the registry files)?

@ouuan

ouuan commented Jun 5, 2021

Copy link
Copy Markdown
Member

BTW, should we also do this for Windows (by editing the registry files)?

Oh, I forgot that this is just a part of #846. We can do it for both Windows and Linux.

@ouuan

ouuan commented Jun 5, 2021

Copy link
Copy Markdown
Member

I think we'd better open a new issue. #846 was two problems mixed into one issue.

@swiftqwq

swiftqwq commented Jun 5, 2021

Copy link
Copy Markdown
Member Author

I think we'd better open a new issue. #846 was two problems mixed into one issue.

I've open #855.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Associate source files to open in cpeditor on macOS

4 participants