mirror of
https://github.com/itay-grudev/SingleApplication.git
synced 2024-11-15 12:15:43 +08:00
522 lines
32 KiB
HTML
522 lines
32 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.9.1"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<!-- BEGIN opengraph metadata -->
|
|
<meta property="og:title" content="Doxygen Awesome" />
|
|
<meta property="og:image" content="https://repository-images.githubusercontent.com/348492097/4f16df80-88fb-11eb-9d31-4015ff22c452" />
|
|
<meta property="og:description" content="Custom CSS theme for doxygen html-documentation with lots of customization parameters." />
|
|
<meta property="og:url" content="https://jothepro.github.io/doxygen-awesome-css/" />
|
|
<!-- END opengraph metadata -->
|
|
<!-- BEGIN twitter metadata -->
|
|
<meta name="twitter:image:src" content="https://repository-images.githubusercontent.com/348492097/4f16df80-88fb-11eb-9d31-4015ff22c452" />
|
|
<meta name="twitter:title" content="Doxygen Awesome" />
|
|
<meta name="twitter:description" content="Custom CSS theme for doxygen html-documentation with lots of customization parameters." />
|
|
<!-- END twitter metadata -->
|
|
<title>SingleApplication: SingleApplication Class Reference</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<link rel="icon" type="image/svg+xml" href="logo.drawio.svg"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<script type="text/javascript" src="doxygen-awesome-darkmode-toggle.js"></script>
|
|
<script type="text/javascript" src="doxygen-awesome-fragment-copy-button.js"></script>
|
|
<script type="text/javascript" src="doxygen-awesome-paragraph-link.js"></script>
|
|
<script type="text/javascript" src="toggle-alternative-theme.js"></script>
|
|
<script type="text/javascript">
|
|
DoxygenAwesomeFragmentCopyButton.init()
|
|
DoxygenAwesomeDarkModeToggle.init()
|
|
DoxygenAwesomeParagraphLink.init()
|
|
</script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body>
|
|
<!-- https://tholman.com/github-corners/ -->
|
|
<a href="https://github.com/itay-grudev/SingleApplication" class="github-corner" title="View source on GitHub" target="_blank">
|
|
<svg viewBox="0 0 250 250" width="40" height="40" style="position: absolute; top: 0; border: 0; right: 0; z-index: 99;" aria-hidden="true">
|
|
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">SingleApplication
|
|
</div>
|
|
<div id="projectbrief">Replacement for QtSingleApplication</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.9.1 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(document).ready(function(){initNavTree('classSingleApplication.html',''); initResizable(); });
|
|
/* @license-end */
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-types">Public Types</a> |
|
|
<a href="#signals">Signals</a> |
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="classSingleApplication-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">SingleApplication Class Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>Handles multiple instances of the same Application.
|
|
<a href="classSingleApplication.html#details">More...</a></p>
|
|
|
|
<p><code>#include <<a class="el" href="singleapplication_8h_source.html">singleapplication.h</a>></code></p>
|
|
<div class="dynheader">
|
|
Inheritance diagram for SingleApplication:</div>
|
|
<div class="dyncontent">
|
|
<div class="center">
|
|
<img src="classSingleApplication.png" alt=""/>
|
|
</div></div>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
|
|
Public Types</h2></td></tr>
|
|
<tr class="memitem:af627160aff1baf822780f3232e43cc3f"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3f">Mode</a> { <br />
|
|
  <a class="el" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fa17303c0281bc4e2fb3828c2ed4bcf795">User</a> = 1 << 0
|
|
, <a class="el" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fa3a5bcecf2993a8a3e108e10b7819c2c3">System</a> = 1 << 1
|
|
, <a class="el" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fae9f77ee5f0c937af0a65b95c25027653">SecondaryNotification</a> = 1 << 2
|
|
, <a class="el" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fa7b64a607dead1807e099f68c22ea0014">ExcludeAppVersion</a> = 1 << 3
|
|
, <br />
|
|
  <a class="el" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fa803baaaf15d8c409637cffdedc14173c">ExcludeAppPath</a> = 1 << 4
|
|
<br />
|
|
}</td></tr>
|
|
<tr class="memdesc:af627160aff1baf822780f3232e43cc3f"><td class="mdescLeft"> </td><td class="mdescRight">Mode of operation of <code><a class="el" href="classSingleApplication.html" title="Handles multiple instances of the same Application.">SingleApplication</a></code>. Whether the block should be user-wide or system-wide and whether the primary instance should be notified when a secondary instance had been started. <a href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3f">More...</a><br /></td></tr>
|
|
<tr class="separator:af627160aff1baf822780f3232e43cc3f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a24f22117a871632e5a9da06734b262bd"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classSingleApplication.html#a24f22117a871632e5a9da06734b262bd">SendMode</a> { <b>NonBlocking</b>
|
|
, <a class="el" href="classSingleApplication.html#a24f22117a871632e5a9da06734b262bda838535d1d486f2536110a4d20687b305">BlockUntilPrimaryExit</a>
|
|
}</td></tr>
|
|
<tr class="memdesc:a24f22117a871632e5a9da06734b262bd"><td class="mdescLeft"> </td><td class="mdescRight">Mode of operation of sendMessage. <a href="classSingleApplication.html#a24f22117a871632e5a9da06734b262bd">More...</a><br /></td></tr>
|
|
<tr class="separator:a24f22117a871632e5a9da06734b262bd"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="signals"></a>
|
|
Signals</h2></td></tr>
|
|
<tr class="memitem:a1aaf2ba6e56fc03638d283d7a39584b1"><td class="memItemLeft" align="right" valign="top"><a id="a1aaf2ba6e56fc03638d283d7a39584b1"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classSingleApplication.html#a1aaf2ba6e56fc03638d283d7a39584b1">instanceStarted</a> ()</td></tr>
|
|
<tr class="memdesc:a1aaf2ba6e56fc03638d283d7a39584b1"><td class="mdescLeft"> </td><td class="mdescRight">Triggered whenever a new instance had been started, except for secondary instances if the <code>Mode::SecondaryNotification</code> flag is not specified. <br /></td></tr>
|
|
<tr class="separator:a1aaf2ba6e56fc03638d283d7a39584b1"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a140e450a0d701fab720403e3eeb15715"><td class="memItemLeft" align="right" valign="top"><a id="a140e450a0d701fab720403e3eeb15715"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classSingleApplication.html#a140e450a0d701fab720403e3eeb15715">receivedMessage</a> (quint32 <a class="el" href="classSingleApplication.html#ac0c288b9fcc6db6abf0977c7fe102189">instanceId</a>, QByteArray message)</td></tr>
|
|
<tr class="memdesc:a140e450a0d701fab720403e3eeb15715"><td class="mdescLeft"> </td><td class="mdescRight">Triggered whenever there is a message received from a secondary instance. <br /></td></tr>
|
|
<tr class="separator:a140e450a0d701fab720403e3eeb15715"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
|
|
Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:a559ac42e5b41d257eb33d010756eee61"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classSingleApplication.html#a559ac42e5b41d257eb33d010756eee61">SingleApplication</a> (int &argc, char *argv[], bool allowSecondary=false, Options options=Mode::User, int timeout=1000, const QString &<a class="el" href="classSingleApplication.html#a4ab1f96fb881f7c35639eb6f2572535e">userData</a>={})</td></tr>
|
|
<tr class="memdesc:a559ac42e5b41d257eb33d010756eee61"><td class="mdescLeft"> </td><td class="mdescRight">Intitializes a <code><a class="el" href="classSingleApplication.html" title="Handles multiple instances of the same Application.">SingleApplication</a></code> instance with argc command line arguments in argv. <a href="classSingleApplication.html#a559ac42e5b41d257eb33d010756eee61">More...</a><br /></td></tr>
|
|
<tr class="separator:a559ac42e5b41d257eb33d010756eee61"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a36af8526d9c0aead9e2fb4c6e1ef532d"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classSingleApplication.html#a36af8526d9c0aead9e2fb4c6e1ef532d">isPrimary</a> () const</td></tr>
|
|
<tr class="memdesc:a36af8526d9c0aead9e2fb4c6e1ef532d"><td class="mdescLeft"> </td><td class="mdescRight">Checks if the instance is primary instance. <a href="classSingleApplication.html#a36af8526d9c0aead9e2fb4c6e1ef532d">More...</a><br /></td></tr>
|
|
<tr class="separator:a36af8526d9c0aead9e2fb4c6e1ef532d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a2da2bd95ebb216d36efcfe61f6684fbd"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classSingleApplication.html#a2da2bd95ebb216d36efcfe61f6684fbd">isSecondary</a> () const</td></tr>
|
|
<tr class="memdesc:a2da2bd95ebb216d36efcfe61f6684fbd"><td class="mdescLeft"> </td><td class="mdescRight">Checks if the instance is a secondary instance. <a href="classSingleApplication.html#a2da2bd95ebb216d36efcfe61f6684fbd">More...</a><br /></td></tr>
|
|
<tr class="separator:a2da2bd95ebb216d36efcfe61f6684fbd"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac0c288b9fcc6db6abf0977c7fe102189"><td class="memItemLeft" align="right" valign="top">quint32 </td><td class="memItemRight" valign="bottom"><a class="el" href="classSingleApplication.html#ac0c288b9fcc6db6abf0977c7fe102189">instanceId</a> () const</td></tr>
|
|
<tr class="memdesc:ac0c288b9fcc6db6abf0977c7fe102189"><td class="mdescLeft"> </td><td class="mdescRight">Returns a unique identifier for the current instance. <a href="classSingleApplication.html#ac0c288b9fcc6db6abf0977c7fe102189">More...</a><br /></td></tr>
|
|
<tr class="separator:ac0c288b9fcc6db6abf0977c7fe102189"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a7daa49ae816cbb2522af9dddf18cd103"><td class="memItemLeft" align="right" valign="top">qint64 </td><td class="memItemRight" valign="bottom"><a class="el" href="classSingleApplication.html#a7daa49ae816cbb2522af9dddf18cd103">primaryPid</a> () const</td></tr>
|
|
<tr class="memdesc:a7daa49ae816cbb2522af9dddf18cd103"><td class="mdescLeft"> </td><td class="mdescRight">Returns the process ID (PID) of the primary instance. <a href="classSingleApplication.html#a7daa49ae816cbb2522af9dddf18cd103">More...</a><br /></td></tr>
|
|
<tr class="separator:a7daa49ae816cbb2522af9dddf18cd103"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aaac54339fe4046596b56980ddc5d93f3"><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><a class="el" href="classSingleApplication.html#aaac54339fe4046596b56980ddc5d93f3">primaryUser</a> () const</td></tr>
|
|
<tr class="memdesc:aaac54339fe4046596b56980ddc5d93f3"><td class="mdescLeft"> </td><td class="mdescRight">Returns the username of the user running the primary instance. <a href="classSingleApplication.html#aaac54339fe4046596b56980ddc5d93f3">More...</a><br /></td></tr>
|
|
<tr class="separator:aaac54339fe4046596b56980ddc5d93f3"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a0a4a6c59b97053140412b39837fa5cd4"><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><a class="el" href="classSingleApplication.html#a0a4a6c59b97053140412b39837fa5cd4">currentUser</a> () const</td></tr>
|
|
<tr class="memdesc:a0a4a6c59b97053140412b39837fa5cd4"><td class="mdescLeft"> </td><td class="mdescRight">Returns the username of the current user. <a href="classSingleApplication.html#a0a4a6c59b97053140412b39837fa5cd4">More...</a><br /></td></tr>
|
|
<tr class="separator:a0a4a6c59b97053140412b39837fa5cd4"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aefbc2f33e22cbdcdafdfbf132b9d9ef1"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classSingleApplication.html#aefbc2f33e22cbdcdafdfbf132b9d9ef1">sendMessage</a> (const QByteArray &message, int timeout=100, <a class="el" href="classSingleApplication.html#a24f22117a871632e5a9da06734b262bd">SendMode</a> sendMode=NonBlocking)</td></tr>
|
|
<tr class="memdesc:aefbc2f33e22cbdcdafdfbf132b9d9ef1"><td class="mdescLeft"> </td><td class="mdescRight">Sends a message to the primary instance. <a href="classSingleApplication.html#aefbc2f33e22cbdcdafdfbf132b9d9ef1">More...</a><br /></td></tr>
|
|
<tr class="separator:aefbc2f33e22cbdcdafdfbf132b9d9ef1"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a4ab1f96fb881f7c35639eb6f2572535e"><td class="memItemLeft" align="right" valign="top">QStringList </td><td class="memItemRight" valign="bottom"><a class="el" href="classSingleApplication.html#a4ab1f96fb881f7c35639eb6f2572535e">userData</a> () const</td></tr>
|
|
<tr class="memdesc:a4ab1f96fb881f7c35639eb6f2572535e"><td class="mdescLeft"> </td><td class="mdescRight">Get the set user data. <a href="classSingleApplication.html#a4ab1f96fb881f7c35639eb6f2572535e">More...</a><br /></td></tr>
|
|
<tr class="separator:a4ab1f96fb881f7c35639eb6f2572535e"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>Handles multiple instances of the same Application. </p>
|
|
<dl class="section see"><dt>See also</dt><dd>QCoreApplication </dd></dl>
|
|
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
|
|
<a id="af627160aff1baf822780f3232e43cc3f"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#af627160aff1baf822780f3232e43cc3f">◆ </a></span>Mode</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">enum <a class="el" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3f">SingleApplication::Mode</a></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Mode of operation of <code><a class="el" href="classSingleApplication.html" title="Handles multiple instances of the same Application.">SingleApplication</a></code>. Whether the block should be user-wide or system-wide and whether the primary instance should be notified when a secondary instance had been started. </p>
|
|
<dl class="section note"><dt>Note</dt><dd>Operating system can restrict the shared memory blocks to the same user, in which case the User/System modes will have no effect and the block will be user wide. </dd></dl>
|
|
<table class="fieldtable">
|
|
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="af627160aff1baf822780f3232e43cc3fa17303c0281bc4e2fb3828c2ed4bcf795"></a>User </td><td class="fielddoc"><p>The <code><a class="el" href="classSingleApplication.html" title="Handles multiple instances of the same Application.">SingleApplication</a></code> block should apply user wide (this adds user specific data to the key used for the shared memory and server name) </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><a id="af627160aff1baf822780f3232e43cc3fa3a5bcecf2993a8a3e108e10b7819c2c3"></a>System </td><td class="fielddoc"><p>The <code><a class="el" href="classSingleApplication.html" title="Handles multiple instances of the same Application.">SingleApplication</a></code> block applies system-wide. </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><a id="af627160aff1baf822780f3232e43cc3fae9f77ee5f0c937af0a65b95c25027653"></a>SecondaryNotification </td><td class="fielddoc"><p>Whether to trigger <code><a class="el" href="classSingleApplication.html#a1aaf2ba6e56fc03638d283d7a39584b1" title="Triggered whenever a new instance had been started, except for secondary instances if the Mode::Secon...">instanceStarted()</a></code> even whenever secondary instances are started </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><a id="af627160aff1baf822780f3232e43cc3fa7b64a607dead1807e099f68c22ea0014"></a>ExcludeAppVersion </td><td class="fielddoc"><p>Excludes the application version from the server name (and memory block) hash </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><a id="af627160aff1baf822780f3232e43cc3fa803baaaf15d8c409637cffdedc14173c"></a>ExcludeAppPath </td><td class="fielddoc"><p>Excludes the application path from the server name (and memory block) hash </p>
|
|
</td></tr>
|
|
</table>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a24f22117a871632e5a9da06734b262bd"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a24f22117a871632e5a9da06734b262bd">◆ </a></span>SendMode</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">enum <a class="el" href="classSingleApplication.html#a24f22117a871632e5a9da06734b262bd">SingleApplication::SendMode</a></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Mode of operation of sendMessage. </p>
|
|
<table class="fieldtable">
|
|
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a24f22117a871632e5a9da06734b262bda838535d1d486f2536110a4d20687b305"></a>BlockUntilPrimaryExit </td><td class="fielddoc"><p>Do not wait for the primary instance termination and return immediately </p>
|
|
</td></tr>
|
|
</table>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a id="a559ac42e5b41d257eb33d010756eee61"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a559ac42e5b41d257eb33d010756eee61">◆ </a></span>SingleApplication()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">SingleApplication::SingleApplication </td>
|
|
<td>(</td>
|
|
<td class="paramtype">int & </td>
|
|
<td class="paramname"><em>argc</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"><em>argv</em>[], </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>allowSecondary</em> = <code>false</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">Options </td>
|
|
<td class="paramname"><em>options</em> = <code>Mode::User</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"><em>timeout</em> = <code>1000</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const QString & </td>
|
|
<td class="paramname"><em>userData</em> = <code>{}</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">explicit</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Intitializes a <code><a class="el" href="classSingleApplication.html" title="Handles multiple instances of the same Application.">SingleApplication</a></code> instance with argc command line arguments in argv. </p>
|
|
<ul>
|
|
<li>argc - Number of arguments in argv </li>
|
|
<li>argv - Supplied command line arguments </li>
|
|
<li>allowSecondary - Whether to start the instance as secondary if there is already a primary instance. </li>
|
|
<li>mode - Whether for the <code><a class="el" href="classSingleApplication.html" title="Handles multiple instances of the same Application.">SingleApplication</a></code> block to be applied User wide or System wide. </li>
|
|
<li>timeout - Timeout to wait in milliseconds. <dl class="section note"><dt>Note</dt><dd>argc and argv may be changed as Qt removes arguments that it recognizes </dd>
|
|
<dd>
|
|
<code>Mode::SecondaryNotification</code> only works if set on both the primary instance and the secondary instance. </dd>
|
|
<dd>
|
|
The timeout is just a hint for the maximum time of blocking operations. It does not guarantee that the <code><a class="el" href="classSingleApplication.html" title="Handles multiple instances of the same Application.">SingleApplication</a></code> initialisation will be completed in given time, though is a good hint. Usually 4*timeout would be the worst case (fail) scenario. </dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd>See the corresponding <code>QAPPLICATION_CLASS</code> constructor for reference </dd></dl>
|
|
</li>
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="a0a4a6c59b97053140412b39837fa5cd4"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a0a4a6c59b97053140412b39837fa5cd4">◆ </a></span>currentUser()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">QString SingleApplication::currentUser </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Returns the username of the current user. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>user name </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ac0c288b9fcc6db6abf0977c7fe102189"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ac0c288b9fcc6db6abf0977c7fe102189">◆ </a></span>instanceId()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">quint32 SingleApplication::instanceId </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Returns a unique identifier for the current instance. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>instance id </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a36af8526d9c0aead9e2fb4c6e1ef532d"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a36af8526d9c0aead9e2fb4c6e1ef532d">◆ </a></span>isPrimary()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool SingleApplication::isPrimary </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Checks if the instance is primary instance. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the instance is primary </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a2da2bd95ebb216d36efcfe61f6684fbd"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a2da2bd95ebb216d36efcfe61f6684fbd">◆ </a></span>isSecondary()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool SingleApplication::isSecondary </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Checks if the instance is a secondary instance. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the instance is secondary </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a7daa49ae816cbb2522af9dddf18cd103"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a7daa49ae816cbb2522af9dddf18cd103">◆ </a></span>primaryPid()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">qint64 SingleApplication::primaryPid </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Returns the process ID (PID) of the primary instance. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>pid </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aaac54339fe4046596b56980ddc5d93f3"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aaac54339fe4046596b56980ddc5d93f3">◆ </a></span>primaryUser()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">QString SingleApplication::primaryUser </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Returns the username of the user running the primary instance. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>user name </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aefbc2f33e22cbdcdafdfbf132b9d9ef1"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aefbc2f33e22cbdcdafdfbf132b9d9ef1">◆ </a></span>sendMessage()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool SingleApplication::sendMessage </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const QByteArray & </td>
|
|
<td class="paramname"><em>message</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"><em>timeout</em> = <code>100</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="classSingleApplication.html#a24f22117a871632e5a9da06734b262bd">SendMode</a> </td>
|
|
<td class="paramname"><em>sendMode</em> = <code>NonBlocking</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Sends a message to the primary instance. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">message</td><td>data to send </td></tr>
|
|
<tr><td class="paramname">timeout</td><td>timeout for connecting </td></tr>
|
|
<tr><td class="paramname">sendMode</td><td>- Mode of operation </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd><code>true</code> on success </dd></dl>
|
|
<dl class="section note"><dt>Note</dt><dd><a class="el" href="classSingleApplication.html#aefbc2f33e22cbdcdafdfbf132b9d9ef1" title="Sends a message to the primary instance.">sendMessage()</a> will return false if invoked from the primary instance </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a4ab1f96fb881f7c35639eb6f2572535e"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a4ab1f96fb881f7c35639eb6f2572535e">◆ </a></span>userData()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">QStringList SingleApplication::userData </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the set user data. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>user data </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
|
<li><a class="el" href="singleapplication_8h_source.html">singleapplication.h</a></li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="classSingleApplication.html">SingleApplication</a></li>
|
|
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|