"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/application.cpp" between
seafile-client-7.0.4.tar.gz and seafile-client-7.0.5.tar.gz

About: Seafile (client) for the Seafile cloud storage system.

application.cpp  (seafile-client-7.0.4):application.cpp  (seafile-client-7.0.5)
#include "application.h" #include "application.h"
#include <objc/objc.h> #include <objc/objc.h>
#include <objc/message.h> #include <objc/message.h>
#include <QFileOpenEvent> #include <QFileOpenEvent>
#include "open-local-helper.h" #include "open-local-helper.h"
#include "ui/main-window.h" #include "ui/main-window.h"
#include "seafile-applet.h" #include "seafile-applet.h"
static bool dockClickHandler(id self,SEL _cmd,...)
{ // static bool dockClickHandler(id self,SEL _cmd,...)
Q_UNUSED(self) // {
Q_UNUSED(_cmd) // Q_UNUSED(self)
if (seafApplet) { // Q_UNUSED(_cmd)
MainWindow *main_win = seafApplet->mainWindow(); // if (seafApplet) {
if (main_win) // MainWindow *main_win = seafApplet->mainWindow();
main_win->showWindow(); // if (main_win)
} // main_win->showWindow();
return true; // }
} // return true;
// }
Application::Application (int &argc, char **argv):QApplication(argc, argv) Application::Application (int &argc, char **argv):QApplication(argc, argv)
{ {
objc_object* cls = (objc_object *)objc_getClass("NSApplication"); // objc_object* cls = (objc_object *)objc_getClass("NSApplication");
SEL sharedApplication = sel_registerName("sharedApplication"); // SEL sharedApplication = sel_registerName("sharedApplication");
objc_object* appInst = objc_msgSend(cls,sharedApplication); // objc_object* appInst = objc_msgSend(cls,sharedApplication);
if(appInst != NULL) // if(appInst != NULL)
{ // {
objc_object* delegate = objc_msgSend(appInst, sel_registerName("delegate // objc_object* delegate = objc_msgSend(appInst, sel_registerName("deleg
")); ate"));
objc_object* delClass = objc_msgSend(delegate, sel_registerName("class" // objc_object* delClass = objc_msgSend(delegate, sel_registerName("cla
)); ss"));
class_addMethod((Class)delClass, sel_registerName("applicationShouldHand // class_addMethod((Class)delClass, sel_registerName("applicationShouldH
leReopen:hasVisibleWindows:"), (IMP)dockClickHandler, "B@:"); andleReopen:hasVisibleWindows:"), (IMP)dockClickHandler, "B@:");
} // }
} }
bool Application::event(QEvent *e) bool Application::event(QEvent *e)
{ {
if (e->type() == QEvent::FileOpen) if (e->type() == QEvent::FileOpen)
{ {
QFileOpenEvent *event = static_cast<QFileOpenEvent *>(e); QFileOpenEvent *event = static_cast<QFileOpenEvent *>(e);
// this event has native mac handler callee // this event has native mac handler callee
if(event && event->url().scheme() == "seafile") if(event && event->url().scheme() == "seafile")
{ {
 End of changes. 2 change blocks. 
24 lines changed or deleted 25 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)