1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-01-07 07:41:54 +01:00

Move mac init code after logging init.

(cherry picked from commit 058e421827)
This commit is contained in:
John Maguire 2012-01-04 14:08:31 +00:00 committed by David Sansome
parent ac44b33ec8
commit f1af27f849

View File

@ -142,19 +142,8 @@ void LoadTranslation(const QString& prefix, const QString& path,
#include <xrme/connection.h> #include <xrme/connection.h>
#endif #endif
int main(int argc, char *argv[]) { void IncreaseFDLimit() {
if (CrashReporting::SendCrashReport(argc, argv)) {
return 0;
}
CrashReporting crash_reporting;
#ifdef Q_OS_DARWIN #ifdef Q_OS_DARWIN
// Do Mac specific startup to get media keys working.
// This must go before QApplication initialisation.
mac::MacMain();
{
// Bump the soft limit for the number of file descriptors from the default of 256 to // Bump the soft limit for the number of file descriptors from the default of 256 to
// the maximum (usually 10240). // the maximum (usually 10240).
struct rlimit limit; struct rlimit limit;
@ -171,7 +160,20 @@ int main(int argc, char *argv[]) {
if (ret == 0) { if (ret == 0) {
qLog(Debug) << "Max fd:" << max_fd; qLog(Debug) << "Max fd:" << max_fd;
} }
#endif
} }
int main(int argc, char *argv[]) {
if (CrashReporting::SendCrashReport(argc, argv)) {
return 0;
}
CrashReporting crash_reporting;
#ifdef Q_OS_DARWIN
// Do Mac specific startup to get media keys working.
// This must go before QApplication initialisation.
mac::MacMain();
#endif #endif
QCoreApplication::setApplicationName("Clementine"); QCoreApplication::setApplicationName("Clementine");
@ -289,6 +291,8 @@ int main(int argc, char *argv[]) {
logging::SetLevels(options.log_levels()); logging::SetLevels(options.log_levels());
g_log_set_default_handler(reinterpret_cast<GLogFunc>(&logging::GLog), NULL); g_log_set_default_handler(reinterpret_cast<GLogFunc>(&logging::GLog), NULL);
IncreaseFDLimit();
QtSingleApplication a(argc, argv); QtSingleApplication a(argc, argv);
#ifdef Q_OS_DARWIN #ifdef Q_OS_DARWIN
QCoreApplication::setLibraryPaths( QCoreApplication::setLibraryPaths(