Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:munix9:unstable
celestia
fix-appimage_dir.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fix-appimage_dir.patch of Package celestia
diff -ruNp a/src/celestia/qt/qtmain.cpp b/src/celestia/qt/qtmain.cpp --- a/src/celestia/qt/qtmain.cpp +++ b/src/celestia/qt/qtmain.cpp @@ -71,6 +71,9 @@ int main(int argc, char *argv[]) CelestiaCore::initLocale(); #ifdef ENABLE_NLS QString localeDir = LOCALEDIR; + QString appimageDir = QString::fromLocal8Bit(::getenv("APPDIR")); + if (!appimageDir.isEmpty()) + localeDir = appimageDir + "/" + localeDir; bindTextDomainUTF8("celestia", localeDir); bindTextDomainUTF8("celestia-data", localeDir); textdomain("celestia"); diff -ruNp a/src/celestia/celestiacore.cpp b/src/celestia/celestiacore.cpp --- a/src/celestia/celestiacore.cpp +++ b/src/celestia/celestiacore.cpp @@ -117,12 +117,19 @@ bool is_valid_directory(const fs::path& bool ReadLeapSecondsFile(const fs::path& path, std::vector<astro::LeapSecondRecord> &leapSeconds) { - std::ifstream file(path); + fs::path myPath; + const auto *appimageDir = getenv("APPDIR"); + if (appimageDir != nullptr) + myPath = fs::path(appimageDir); + myPath += path; + + std::ifstream file(myPath); if (!file.good()) { - GetLogger()->error(_("Failed to open leapseconds file {}\n"), path); + GetLogger()->error(_("Failed to open leapseconds file {}\n"), myPath); return false; } + GetLogger()->info(_("Leapseconds file {} found\n"), myPath); std::string s; for (int line = 1; std::getline(file, s); line++) @@ -139,7 +146,7 @@ bool ReadLeapSecondsFile(const fs::path& if (std::sscanf(ptr, "%" SCNuLEAST32 " %i", ×tamp, &seconds) != 2) { GetLogger()->error(_("Failed to parse leapseconds file {}, line {}, column {}\n"), - path, line, ptr - &s[0]); + myPath, line, ptr - &s[0]); leapSeconds.clear(); return false; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor