Skip to content

added ~ support and error handling#3

Merged
ravachol merged 3 commits intoravachol:mainfrom
jothi-prasath:main
Jun 13, 2023
Merged

added ~ support and error handling#3
ravachol merged 3 commits intoravachol:mainfrom
jothi-prasath:main

Conversation

@jothi-prasath
Copy link
Contributor

Description

This PR adds ~ support and error handling

Changes Made

  • Added support for handling ~ . eg., cue path ~/Music
  • Error handling when the given path is not exist

@jothi-prasath jothi-prasath changed the title added ~ support added ~ support and error handling Jun 10, 2023
@ravachol
Copy link
Owner

Would be better to have this inside the saveSettings function so that the main function remains small and tidy.

This reverts commit ce33dba.
@jothi-prasath
Copy link
Contributor Author

jothi-prasath commented Jun 10, 2023

i didnt get it

@ravachol
Copy link
Owner

to move your error handling inside the saveSettings function, so that it doesn't clutter main().

@jothi-prasath
Copy link
Contributor Author

so the saveSettings function is located in settings.h file, right?

@ravachol
Copy link
Owner

Yes

@ravachol
Copy link
Owner

I'm going to rewrite that later to allow for key/value pairs but could use that error checking anyway.

@jothi-prasath
Copy link
Contributor Author

this work c97b1fb

@jothi-prasath
Copy link
Contributor Author

Yes

now only i see this i created a function inside the cue.c

@ravachol
Copy link
Owner

I would prefer if the main function was just calls to other functions and no code. so put everything in saveSettings please. Btw, thanks for helping out, @jothi-prasath.

@ravachol
Copy link
Owner

Best would be to put expandPath in dir.c and #include "dir.h" in settings.h. Then call expandPath from within the saveSettings function, instead of doing it in main().

@jothi-prasath
Copy link
Contributor Author

Thanks! However, I must admit that I currently have limited knowledge and experience with header files and c. While I am eager to learn and improve my skills, I might require some guidance or assistance to correctly implement the changes you proposed. I would be grateful if you or other experienced contributors could provide some direction or collaborate with me on this matter.

@ravachol
Copy link
Owner

Sure, no problem. I'll merge your commit and then do the required changes. But not today.

@ravachol
Copy link
Owner

ravachol commented Jun 13, 2023

The way header files work is they contain the signature of the functions. so the settings.h should contain the line:

void expandPath(const char *inputPath, char *expandedPath);

Like that, with a semicolon at the end. When that is done any file that contains #include <settings.h> can call expandPath, and it will execute the function in <settings.c> provided you put the expandPath function there.

@ravachol ravachol merged commit e166621 into ravachol:main Jun 13, 2023
@ravachol
Copy link
Owner

I had to add some stuff to expandPath.

ravachol pushed a commit that referenced this pull request Oct 6, 2025
…ut album art when in landscape mode' (#3) from hartalex/kew:fix-2 into develop

Reviewed-on: https://codeberg.org/ravachol/kew/pulls/3
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.

2 participants