00001 #include <qfile.h> 00002 QString getHomeDir(){ 00003 std::system("echo $HOME 1>homeDir.dat"); 00004 QFile file("homeDir.dat"); 00005 QString homeDir; 00006 if(!file.open(IO_ReadOnly)) 00007 return homeDir; 00008 QTextStream stream(&file); 00009 homeDir = stream.readLine(); 00010 return homeDir; 00011 }