Moved to std::string from std::strstream
This commit is contained in:
parent
49f3715f0c
commit
66ea6cf782
1 changed files with 19 additions and 20 deletions
35
src/Theme.cc
35
src/Theme.cc
|
@ -41,7 +41,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Theme.cc,v 1.8 2002/01/08 00:12:51 fluxgen Exp $
|
// $Id: Theme.cc,v 1.9 2002/01/08 11:37:15 fluxgen Exp $
|
||||||
|
|
||||||
#ifndef _GNU_SOURCE
|
#ifndef _GNU_SOURCE
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
|
@ -66,7 +66,6 @@
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <strstream>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
@ -657,15 +656,15 @@ void Theme::loadRootCommand() {
|
||||||
|
|
||||||
if (m_rootcommand.size()) {
|
if (m_rootcommand.size()) {
|
||||||
#ifndef __EMX__
|
#ifndef __EMX__
|
||||||
//const int display_strlen = 1024;
|
char tmpstring[256]; //to hold m_screennum
|
||||||
//char displaystring[display_strlen];
|
tmpstring[0]=0;
|
||||||
strstream displaystring;
|
sprintf(tmpstring, "%d", m_screennum);
|
||||||
displaystring<<"DISPLAY="<<DisplayString(m_display)<<m_screennum;
|
string displaystring("DISPLAY=");
|
||||||
cerr<<__FILE__<<"("<<__LINE__<<"): displaystring="<<displaystring.str()<<endl;
|
displaystring.append(DisplayString(m_display));
|
||||||
//snprintf(displaystring, display_strlen, "DISPLAY=%s%d",
|
displaystring.append(tmpstring); // append m_screennum
|
||||||
//DisplayString(m_display), m_screennum);
|
cerr<<__FILE__<<"("<<__LINE__<<"): displaystring="<<displaystring.c_str()<<endl;
|
||||||
|
|
||||||
bexec(m_rootcommand.c_str(), displaystring.str());
|
bexec(m_rootcommand.c_str(), const_cast<char *>(displaystring.c_str()));
|
||||||
#else // __EMX__
|
#else // __EMX__
|
||||||
spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", m_rootcommand.c_str(), NULL);
|
spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", m_rootcommand.c_str(), NULL);
|
||||||
#endif // !__EMX__
|
#endif // !__EMX__
|
||||||
|
@ -677,15 +676,15 @@ void Theme::loadRootCommand() {
|
||||||
} else if (XrmGetResource(m_database, "rootCommand",
|
} else if (XrmGetResource(m_database, "rootCommand",
|
||||||
"RootCommand", &value_type, &value)) {
|
"RootCommand", &value_type, &value)) {
|
||||||
#ifndef __EMX__
|
#ifndef __EMX__
|
||||||
//const int display_strlen = 1024;
|
char tmpstring[256]; //to hold m_screennum
|
||||||
//char displaystring[display_strlen];
|
tmpstring[0]=0;
|
||||||
strstream displaystring;
|
sprintf(tmpstring, "%d", m_screennum);
|
||||||
displaystring<<"DISPLAY="<<DisplayString(m_display)<<m_screennum;
|
string displaystring("DISPLAY=");
|
||||||
cerr<<__FILE__<<"("<<__LINE__<<"): displaystring="<<displaystring.str()<<endl;
|
displaystring.append(DisplayString(m_display));
|
||||||
//snprintf(displaystring, display_strlen, "DISPLAY=%s%d",
|
displaystring.append(tmpstring); // append m_screennum
|
||||||
// DisplayString(m_display), m_screennum);
|
cerr<<__FILE__<<"("<<__LINE__<<"): displaystring="<<displaystring.c_str()<<endl;
|
||||||
|
|
||||||
bexec(value.addr, displaystring.str());
|
bexec(value.addr, const_cast<char *>(displaystring.c_str()));
|
||||||
#else // __EMX__
|
#else // __EMX__
|
||||||
spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", value.addr, NULL);
|
spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", value.addr, NULL);
|
||||||
#endif // !__EMX__
|
#endif // !__EMX__
|
||||||
|
|
Loading…
Reference in a new issue