mirror of https://github.com/status-im/nimqml.git
Merge pull request #32 from status-im/feat/single-instance-deep-links
Passing custom events over single instance IPC
This commit is contained in:
commit
b67014a56a
|
@ -338,7 +338,7 @@ proc dos_qurl_host(host: cstring): cstring {.cdecl, dynlib: dynLibName, importc.
|
|||
proc dos_qurl_replaceHostAndAddPath(url: cstring, newScheme: cstring, newHost: cstring, pathPrefix: cstring): cstring {.cdecl, dynlib: dynLibName, importc.}
|
||||
|
||||
# SingleInstance
|
||||
proc dos_singleinstance_create(uniqueName: cstring): DosQObject {.cdecl, dynlib: dynLibName, importc.}
|
||||
proc dos_singleinstance_create(uniqueName: cstring, eventStr: cstring): DosQObject {.cdecl, dynlib: dynLibName, importc.}
|
||||
proc dos_singleinstance_isfirst(vptr: DosQObject): bool {.cdecl, dynlib: dynLibName, importc.}
|
||||
proc dos_singleinstance_delete(vptr: DosQObject) {.cdecl, dynlib: dynLibName, importc.}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
proc setup*(self: SingleInstance, uniqueName: string) =
|
||||
proc setup*(self: SingleInstance, uniqueName: string, eventStr: string) =
|
||||
## Setup a new SingleInstance
|
||||
self.vptr = dos_singleinstance_create(uniqueName)
|
||||
self.vptr = dos_singleinstance_create(uniqueName, eventStr)
|
||||
|
||||
proc delete*(self: SingleInstance) =
|
||||
## Delete the given SingleInstance
|
||||
|
@ -9,9 +9,9 @@ proc delete*(self: SingleInstance) =
|
|||
dos_singleinstance_delete(self.vptr)
|
||||
self.vptr.resetToNil
|
||||
|
||||
proc newSingleInstance*(uniqueName: string): SingleInstance =
|
||||
proc newSingleInstance*(uniqueName: string, eventStr: string): SingleInstance =
|
||||
new(result, delete)
|
||||
result.setup(uniqueName)
|
||||
result.setup(uniqueName, eventStr)
|
||||
|
||||
proc secondInstance*(self: SingleInstance): bool =
|
||||
return not dos_singleinstance_isfirst(self.vptr)
|
||||
|
|
Loading…
Reference in New Issue