Skip to content

Commit b3f6d20

Browse files
committed
Mac add missing Qt framework
1 parent 4d4cfc5 commit b3f6d20

File tree

10 files changed

+30
-18
lines changed

10 files changed

+30
-18
lines changed

OSCWidgets.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

OSCWidgets/EosPlatform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2015 Electronic Theatre Controls, Inc., http://www.etcconnect.com
1+
// Copyright (c) 2018 Electronic Theatre Controls, Inc., http://www.etcconnect.com
22
//
33
// Permission is hereby granted, free of charge, to any person obtaining a copy
44
// of this software and associated documentation files (the "Software"), to deal

OSCWidgets/EosPlatform.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2015 Electronic Theatre Controls, Inc., http://www.etcconnect.com
1+
// Copyright (c) 2018 Electronic Theatre Controls, Inc., http://www.etcconnect.com
22
//
33
// Permission is hereby granted, free of charge, to any person obtaining a copy
44
// of this software and associated documentation files (the "Software"), to deal

OSCWidgets/EosPlatform_Mac.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2015 Electronic Theatre Controls, Inc., http://www.etcconnect.com
1+
// Copyright (c) 2018 Electronic Theatre Controls, Inc., http://www.etcconnect.com
22
//
33
// Permission is hereby granted, free of charge, to any person obtaining a copy
44
// of this software and associated documentation files (the "Software"), to deal
@@ -41,7 +41,10 @@ EosPlatform_Mac::~EosPlatform_Mac()
4141
bool EosPlatform_Mac::Initialize(std::string &error)
4242
{
4343
if(m_Platform == 0)
44+
{
4445
m_Platform = Bridge_CreatePlatform(error);
46+
Bridge_InitQtPlugins();
47+
}
4548

4649
return (m_Platform != 0);
4750
}

OSCWidgets/EosPlatform_Mac.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2015 Electronic Theatre Controls, Inc., http://www.etcconnect.com
1+
// Copyright (c) 2018 Electronic Theatre Controls, Inc., http://www.etcconnect.com
22
//
33
// Permission is hereby granted, free of charge, to any person obtaining a copy
44
// of this software and associated documentation files (the "Software"), to deal

OSCWidgets/EosPlatform_Mac_Bridge.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2015 Electronic Theatre Controls, Inc., http://www.etcconnect.com
1+
// Copyright (c) 2018 Electronic Theatre Controls, Inc., http://www.etcconnect.com
22
//
33
// Permission is hereby granted, free of charge, to any person obtaining a copy
44
// of this software and associated documentation files (the "Software"), to deal
@@ -29,6 +29,7 @@ void* Bridge_CreatePlatform(std::string &error);
2929
void Bridge_DestroyPlatform(void *platform);
3030
void* Bridge_BeginActivity(const std::string &reason, std::string &error);
3131
void Bridge_EndActivity(void *activity);
32+
void Bridge_InitQtPlugins();
3233

3334
////////////////////////////////////////////////////////////////////////////////
3435

OSCWidgets/EosPlatform_Mac_Native.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2015 Electronic Theatre Controls, Inc., http://www.etcconnect.com
1+
// Copyright (c) 2018 Electronic Theatre Controls, Inc., http://www.etcconnect.com
22
//
33
// Permission is hereby granted, free of charge, to any person obtaining a copy
44
// of this software and associated documentation files (the "Software"), to deal

OSCWidgets/EosPlatform_Mac_Native.mm

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2015 Electronic Theatre Controls, Inc., http://www.etcconnect.com
1+
// Copyright (c) 2018 Electronic Theatre Controls, Inc., http://www.etcconnect.com
22
//
33
// Permission is hereby granted, free of charge, to any person obtaining a copy
44
// of this software and associated documentation files (the "Software"), to deal
@@ -20,6 +20,9 @@
2020

2121
#import "EosPlatform_Mac_Native.h"
2222
#import "EosPlatform_Mac_Bridge.h"
23+
#import <QtWidgets/QApplication>
24+
#import <QtCore/QDir>
25+
#import <QtCore/QUrl>
2326

2427
////////////////////////////////////////////////////////////////////////////////
2528

@@ -112,3 +115,17 @@ + (void)EndActivity:(id)activity
112115
@end
113116

114117
////////////////////////////////////////////////////////////////////////////////
118+
119+
void Bridge_InitQtPlugins()
120+
{
121+
// only load plugins from our bundle
122+
CFURLRef url = (CFURLRef)CFAutorelease((CFURLRef)CFBundleCopyBundleURL(CFBundleGetMainBundle()));
123+
if(url != nil)
124+
{
125+
QDir dir( QUrl::fromCFURL(url).path() );
126+
if( dir.cd("Contents/Plugins") )
127+
QApplication::setLibraryPaths(QStringList() << dir.canonicalPath());
128+
}
129+
}
130+
131+
////////////////////////////////////////////////////////////////////////////////

OSCWidgets/MainWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
////////////////////////////////////////////////////////////////////////////////
2929

30-
#define APP_VERSION "0.7"
30+
#define APP_VERSION "0.8"
3131

3232
#define MIN_OPACITY 10
3333

OSCWidgets/main.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
#include "Utils.h"
2828
#include "EosPlatform.h"
2929

30-
// TODO: image format plugins!
31-
3230
////////////////////////////////////////////////////////////////////////////////
3331

3432
int main(int argc, char* argv[])
@@ -50,13 +48,6 @@ int main(int argc, char* argv[])
5048
}
5149

5250
QApplication app(argc, argv);
53-
54-
#ifndef WIN32
55-
QDir dir( app.applicationDirPath() );
56-
dir.cdUp();
57-
dir.cd("Plugins");
58-
app.setLibraryPaths( QStringList(dir.canonicalPath()) );
59-
#endif
6051

6152
app.setDesktopSettingsAware(false);
6253
app.setQuitOnLastWindowClosed(false);

0 commit comments

Comments
 (0)