Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Non-C++ Files Around #1521

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

WhiredPlanck
Copy link

Overview

This PR is made up with some commits cherry-picked from #1515 , according to @vedgy 's advice, trying to move some non-C++ files around to make the source tree more tidy.

Details

See the commit message.

@WhiredPlanck
Copy link
Author

LGTM on my Linux system (using Chinese Simplified locale)

图片

@vedgy
Copy link
Member

vedgy commented Jun 15, 2022

Most new file locations look neat. But what is the reasoning behind the Move files in redist to data commit? These files are installed on freedesktop systems, so maybe they should remain in a common directory, separated from other files?

@WhiredPlanck
Copy link
Author

WhiredPlanck commented Jun 15, 2022

These files are installed on freedesktop systems, so maybe they should remain in a common directory, separated from other files?

I’m not very confident about it. According to the projects I’ve seen, they almost put these files into datawith others. I’m not sure if redist actually plays the role of data. Maybe we can remain redist as a separated directory.

UPDATE: Considering GoldenDict is a relatively old project, I think it may be not necessary to move around the files in redist, since it really makes sense there as you said. As long as it may be convenient for the developers of GoldenDict, there is no need to blindly imitate others. Maybe I can drop the commit later?

@vedgy
Copy link
Member

vedgy commented Jun 15, 2022

Maybe we can remain redist as a separated directory.

Yes, I think they should be separate. Especially the icon: with the move it becomes lost among the resource icons.

@WhiredPlanck
Copy link
Author

WhiredPlanck commented Jun 15, 2022

Maybe we can remain redist as a separated directory.

Yes, I think they should be separate. Especially the icon: with the move it becomes lost among the resource icons.

OK ~, let me revert the commit later ~

@WhiredPlanck
Copy link
Author

@vedgy Done ~

@vedgy
Copy link
Member

vedgy commented Jun 16, 2022

How about actually dropping the commit, the reverting commit and force-pushing? Such back-and-forth negatively affects tracking files in git history.

@WhiredPlanck
Copy link
Author

How about actually dropping the commit, the reverting commit and force-pushing? Such back-and-forth negatively affects tracking files in git history.

OK, wait a moment ~

@WhiredPlanck
Copy link
Author

@vedgy Done ~

@vedgy
Copy link
Member

vedgy commented Jun 18, 2022

There are many occurrences of "resources.qrc" in GoldenDict's *.ui files. Could you please find relevant docs or other sources that explain why replacing some of these with "icons.qrc" should or should not be done?

git grep -n resources.qrc

@WhiredPlanck
Copy link
Author

There are many occurrences of "resources.qrc" in GoldenDict's *.ui files. Could you please find relevant docs or other sources that explain why replacing some of these with "icons.qrc" should or should not be done?

git grep -n resources.qrc

Sorry for that I don’t find clear explains for this. But I checked the generated ui_*.h files and find that just the "internal path (identifier)" like ":/icons/<name>.png"actually plays a role.

It seems that Qt will generate the "internal path"s according to the prefix at the head of the icons.qrc file and following picture file names. In this case, I put icons.qrc along with these pictures, and set the prefix as /icons, so Qt will include these pictures and mark the same "internal path" like :icons/<name>.png(just like before) for them. So replacing or not doesn’t matter.

@vedgy
Copy link
Member

vedgy commented Jun 21, 2022

But I checked the generated ui_*.h files and find that just the "internal path (identifier)" like ":/icons/.png"actually plays a role.

Good idea, thanks.

The git grep -Pn '^(?!.*(:|localhost)/).*icons' command reveals more probable issues:

goldendict.pro:238:    ICON = icons/macicon.icns
goldendict.rc:3:IDI_ICON1 ICON DISCARDABLE "icons/programicon.ico"
goldendict.rc:4:IDI_ICON2 ICON DISCARDABLE "icons/programicon_old.ico"
goldendict.vcxproj:1075:    <None Include="icons\error.png" />
...
goldendict.vcxproj.filters:1007:    <None Include="icons\error.png">
...

The *vcxproj* files are probably obsolete, but removing them in #1450 was not merged. If you cannot verify that the changes don't break GoldenDict on other platforms and the pull request doesn't fix actual bugs, I am afraid it is unlikely to be merged.

@WhiredPlanck
Copy link
Author

If you cannot verify that the changes don't break GoldenDict on other platforms ...

Yep, as for now it’s a little difficult for me to verify it because my Visual Studio has some problems to run and I’m too tired to fix it. :/ But I will try to verify again.

... and the pull request doesn't fix actual bugs, I am afraid it is unlikely to be merged.

Don’t worry now, since GoldenDict is a complex project and I realize it takes a lot of time to refactor some imperfect places with your suggestion last time. We can just wait for the right time.

vedgy added a commit to vedgy/goldendict that referenced this pull request May 12, 2023
These files were added almost 10 years ago in
ba94dd1 and haven't been maintained
since 2013. The *.vcxproj* files are certainly out of date and not
working now, because new source files have been added since 2013.
One would need to put in a lot of effort to make the project and
solution usable again. And whoever decides to do that would probably
want to use a newer Visual Studio version. Simply removing this obsolete
solution, then implementing a more modern one from scratch would likely
be easier than updating.

A benefit of removing these files is that new GoldenDict developers
wouldn't have to waste their time wondering whether they should use
goldendict.pro or these files. Also contributors wouldn't have to worry
about updating the Visual Studio project while adding new source files
or renaming/moving existing ones. For example, the unmaintained Visual
Studio project hinders two pull requests: goldendict#1521 and goldendict#1532.

@xiaoyifang proposed the same change in goldendict#1450. No one has explicitly
rejected that older pull request.

This commit reverts ba94dd1, except for
the small change to goldendict.rc, which, judging by
281d3b7, is useful to the qmake-based
Windows build.
@WhiredPlanck
Copy link
Author

WhiredPlanck commented Jul 8, 2023

@vedgy Hi~ More than a year has passed, and recently this PR has come to my mind at last. I've made more refactors to the moving of those non-C++ files (basically the data files). I think you could take a look again now ~

@vedgy
Copy link
Member

vedgy commented Jul 9, 2023

Hi @WhiredPlanck. Can you please summarize your recent changes? (because the GitHub UI isn't very helpful here)

I hope this PR can be simplified once #1639 is merged.

#1532 conflicts with this PR, especially with the commit Linux-specific: Move desktop stuffs to data. #1532 is simpler and addresses a legacy-path issue, so I think it should be merged before this one. Furthermore, I just reread previous comments under this PR and found that moving files from redist to data has been reverted. Why restore this move now?

@WhiredPlanck
Copy link
Author

WhiredPlanck commented Jul 9, 2023

Can you please summarize your recent changes?

Of course ~ Based on the changes before, the refactors also include the change of Visual Studio project and solution files since these files have not been removed yet.

I hope this PR can be simplified once #1639 is merged.

And yes, this PR definitely can be simplified once #1639 is merged.

Also I think it makes sense to move the desktop files and locale files to data, since they are really a kind of data.


#1532 conflicts with this PR, especially with the commit Linux-specific: Move desktop stuffs to data. #1532 is simpler and addresses a legacy-path issue, so I think it should be merged before this one.

That's great. I didn't notice #1532 before. It may also help simplify this PR ~

Why restore this move now?

My fault. I just forgot that we had agreed on this before that not to move them. I was too impulsive to re-read the previous discussion before re-pushing the commits. 🥲

And just for reference: now I think we could move the desktop files into the data , then separate them from other files in it, since they are indeed a kind of data, it seems inappropriate to leave them out like "orphans" (although I have not yet done so, because I want to let you make a quick review first).

Here is a project "crow-translate" for reference. It separates the app icons in a directory from other icons, and put the desktop files in the data directory.

@vedgy
Copy link
Member

vedgy commented Jul 9, 2023

Splitting redist/ into data/redist/ and data/icons/redist/ should be OK, I think. But better wait till #1532 is merged to avoid conflicts.

@WhiredPlanck
Copy link
Author

Splitting redist/ into data/redist/ and data/icons/redist/ should be OK, I think. But better wait till #1532 is merged to avoid conflicts.

OK ~

vedgy added a commit that referenced this pull request Jul 12, 2023
These files were added almost 10 years ago in
ba94dd1 and haven't been maintained
since 2013. The *.vcxproj* files are certainly out of date and not
working now, because new source files have been added since 2013.
One would need to put in a lot of effort to make the project and
solution usable again. And whoever decides to do that would probably
want to use a newer Visual Studio version. Simply removing this obsolete
solution, then implementing a more modern one from scratch would likely
be easier than updating.

A benefit of removing these files is that new GoldenDict developers
wouldn't have to waste their time wondering whether they should use
goldendict.pro or these files. Also contributors wouldn't have to worry
about updating the Visual Studio project while adding new source files
or renaming/moving existing ones. For example, the unmaintained Visual
Studio project hinders two pull requests: #1521 and #1532.

@xiaoyifang proposed the same change in #1450. No one has explicitly
rejected that older pull request.

This commit reverts ba94dd1, except for
the small change to goldendict.rc, which, judging by
281d3b7, is useful to the qmake-based
Windows build.
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.

None yet

2 participants