summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/dasher/QtDasherPlugin.cc4
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp2
-rw-r--r--noncore/settings/usermanager/userdialog.cpp12
3 files changed, 10 insertions, 8 deletions
diff --git a/inputmethods/dasher/QtDasherPlugin.cc b/inputmethods/dasher/QtDasherPlugin.cc
index 50d4539..91167c2 100644
--- a/inputmethods/dasher/QtDasherPlugin.cc
+++ b/inputmethods/dasher/QtDasherPlugin.cc
@@ -1,46 +1,48 @@
1#include "QtDasherPlugin.h" 1#include "QtDasherPlugin.h"
2 2
3#include <qpe/global.h> 3#include <qpe/global.h>
4#include <qpe/qpeapplication.h>
4 5
5#include <qpainter.h> 6#include <qpainter.h>
6#include <qlist.h> 7#include <qlist.h>
7#include <qbitmap.h> 8#include <qbitmap.h>
8#include <qlayout.h> 9#include <qlayout.h>
9#include <qvbox.h> 10#include <qvbox.h>
10#include <qdialog.h> 11#include <qdialog.h>
12#include <qfile.h>
11#include <qscrollview.h> 13#include <qscrollview.h>
12#include <qpopupmenu.h> 14#include <qpopupmenu.h>
13#include <qhbuttongroup.h> 15#include <qhbuttongroup.h>
14#include <qpushbutton.h> 16#include <qpushbutton.h>
15#include <qmessagebox.h> 17#include <qmessagebox.h>
16#include <qwindowsystem_qws.h> 18#include <qwindowsystem_qws.h>
17 19
18QtDasherPlugin::QtDasherPlugin(QWidget* parent, const char* name, WFlags f) : QFrame(parent,name,f) 20QtDasherPlugin::QtDasherPlugin(QWidget* parent, const char* name, WFlags f) : QFrame(parent,name,f)
19{ 21{
20 (new QHBoxLayout(this))->setAutoAdd(TRUE); 22 (new QHBoxLayout(this))->setAutoAdd(TRUE);
21 interface = new CDasherInterface; 23 interface = new CDasherInterface;
22 interface->SetSystemLocation("/opt/QtPalmtop/share/dasher/"); 24 interface->SetSystemLocation( QFile::encodeName(QPEApplication::qpeDir()+"share/dasher/").data() );
23 interface->Unpause(0); 25 interface->Unpause(0);
24 interface->Start(); 26 interface->Start();
25 d = new QtDasherScreen(240,100,interface,this,this); 27 d = new QtDasherScreen(240,100,interface,this,this);
26 interface->ChangeMaxBitRate(2.5); 28 interface->ChangeMaxBitRate(2.5);
27 d->show(); 29 d->show();
28 utf8_codec = new QUtf8Codec; 30 utf8_codec = new QUtf8Codec;
29} 31}
30 32
31QSize QtDasherPlugin::sizeHint() const 33QSize QtDasherPlugin::sizeHint() const
32{ 34{
33 return QSize(240,100); 35 return QSize(240,100);
34} 36}
35 37
36QtDasherPlugin::~QtDasherPlugin() 38QtDasherPlugin::~QtDasherPlugin()
37{ 39{
38 delete interface; 40 delete interface;
39} 41}
40 42
41void QtDasherPlugin::resetState() 43void QtDasherPlugin::resetState()
42{ 44{
43 flushcount=0; 45 flushcount=0;
44 interface->Start(); 46 interface->Start();
45 interface->Redraw(); 47 interface->Redraw();
46} 48}
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index ee01b61..90e44cb 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -139,49 +139,49 @@ void BlueBase::readConfig()
139void BlueBase::writeConfig() 139void BlueBase::writeConfig()
140{ 140{
141 141
142 Config cfg( "bluetoothmanager" ); 142 Config cfg( "bluetoothmanager" );
143 cfg.setGroup( "bluezsettings" ); 143 cfg.setGroup( "bluezsettings" );
144 144
145 cfg.writeEntry( "name" , m_deviceName ); 145 cfg.writeEntry( "name" , m_deviceName );
146 cfg.writeEntryCrypt( "passkey" , m_defaultPasskey ); 146 cfg.writeEntryCrypt( "passkey" , m_defaultPasskey );
147 cfg.writeEntry( "useEncryption" , m_useEncryption ); 147 cfg.writeEntry( "useEncryption" , m_useEncryption );
148 cfg.writeEntry( "enableAuthentification" , m_enableAuthentification ); 148 cfg.writeEntry( "enableAuthentification" , m_enableAuthentification );
149 cfg.writeEntry( "enablePagescan" , m_enablePagescan ); 149 cfg.writeEntry( "enablePagescan" , m_enablePagescan );
150 cfg.writeEntry( "enableInquiryscan" , m_enableInquiryscan ); 150 cfg.writeEntry( "enableInquiryscan" , m_enableInquiryscan );
151 151
152 writeToHciConfig(); 152 writeToHciConfig();
153} 153}
154 154
155/** 155/**
156 * Modify the hcid.conf file to our needs 156 * Modify the hcid.conf file to our needs
157 */ 157 */
158void BlueBase::writeToHciConfig() 158void BlueBase::writeToHciConfig()
159{ 159{
160 owarn << "writeToHciConfig" << oendl; 160 owarn << "writeToHciConfig" << oendl;
161 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" ); 161 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" );
162 hciconf.load(); 162 hciconf.load();
163 hciconf.setPinHelper( "/opt/QtPalmtop/bin/bluepin" ); 163 hciconf.setPinHelper( QPEApplication::qpeDir() + "bin/bluepin" );
164 hciconf.setName( m_deviceName ); 164 hciconf.setName( m_deviceName );
165 hciconf.setEncrypt( m_useEncryption ); 165 hciconf.setEncrypt( m_useEncryption );
166 hciconf.setAuth( m_enableAuthentification ); 166 hciconf.setAuth( m_enableAuthentification );
167 hciconf.setPscan( m_enablePagescan ); 167 hciconf.setPscan( m_enablePagescan );
168 hciconf.setIscan( m_enableInquiryscan ); 168 hciconf.setIscan( m_enableInquiryscan );
169 hciconf.save(); 169 hciconf.save();
170} 170}
171 171
172 172
173/** 173/**
174 * Read the list of allready known devices 174 * Read the list of allready known devices
175 */ 175 */
176void BlueBase::readSavedDevices() 176void BlueBase::readSavedDevices()
177{ 177{
178 178
179 QValueList<RemoteDevice> loadedDevices; 179 QValueList<RemoteDevice> loadedDevices;
180 DeviceHandler handler; 180 DeviceHandler handler;
181 loadedDevices = handler.load(); 181 loadedDevices = handler.load();
182 182
183 addSearchedDevices( loadedDevices ); 183 addSearchedDevices( loadedDevices );
184} 184}
185 185
186 186
187/** 187/**
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp
index 3616507..9dfb2af 100644
--- a/noncore/settings/usermanager/userdialog.cpp
+++ b/noncore/settings/usermanager/userdialog.cpp
@@ -244,53 +244,53 @@ bool UserDialog::addUser(int uid, int gid)
244 accounts->findGroup(adduserDialog->groupComboBox->currentText()); 244 accounts->findGroup(adduserDialog->groupComboBox->currentText());
245 adduserDialog->groupID=accounts->gr_gid; 245 adduserDialog->groupID=accounts->gr_gid;
246 owarn << QString::number(accounts->gr_gid) << oendl; 246 owarn << QString::number(accounts->gr_gid) << oendl;
247 } 247 }
248 if(!(accounts->addUser(adduserDialog->loginLineEdit->text(), adduserDialog->passwordLineEdit->text(), 248 if(!(accounts->addUser(adduserDialog->loginLineEdit->text(), adduserDialog->passwordLineEdit->text(),
249 adduserDialog->uidLineEdit->text().toInt(), adduserDialog->groupID, adduserDialog->gecosLineEdit->text(), 249 adduserDialog->uidLineEdit->text().toInt(), adduserDialog->groupID, adduserDialog->gecosLineEdit->text(),
250 QString("/home/")+adduserDialog->loginLineEdit->text() , adduserDialog->shellComboBox->currentText()))) 250 QString("/home/")+adduserDialog->loginLineEdit->text() , adduserDialog->shellComboBox->currentText())))
251 { 251 {
252 QMessageBox::information(0,"Ooops!","Something went wrong!\nUnable to add user."); 252 QMessageBox::information(0,"Ooops!","Something went wrong!\nUnable to add user.");
253 return false; 253 return false;
254 } 254 }
255 255
256 // Add User to additional groups. 256 // Add User to additional groups.
257 QListViewItemIterator it( adduserDialog->groupsListView ); 257 QListViewItemIterator it( adduserDialog->groupsListView );
258 for ( ; it.current(); ++it ) 258 for ( ; it.current(); ++it )
259 { 259 {
260 temp=(QCheckListItem*)it.current(); 260 temp=(QCheckListItem*)it.current();
261 if (temp->isOn() ) 261 if (temp->isOn() )
262 accounts->addGroupMember(it.current()->text(0),adduserDialog->loginLineEdit->text()); 262 accounts->addGroupMember(it.current()->text(0),adduserDialog->loginLineEdit->text());
263 } 263 }
264 // Copy image to pics/users/ 264 // Copy image to pics/users/
265 if(!(adduserDialog->userImage.isNull())) 265 if(!(adduserDialog->userImage.isNull()))
266 { 266 {
267 QDir d; 267 QDir d;
268 if(!(d.exists("/opt/QtPalmtop/pics/users"))) 268 if(!(d.exists(QPEApplication::qpeDir() + "pics/users")))
269 { 269 {
270 d.mkdir("/opt/QtPalmtop/pics/users"); 270 d.mkdir(QPEApplication::qpeDir() + "pics/users");
271 } 271 }
272 QString filename="/opt/QtPalmtop/pics/users/"+accounts->pw_name+".png"; 272 QString filename= QPEApplication::qpeDir()+"pics/users/"+accounts->pw_name+".png";
273 // adduserDialog->userImage=adduserDialog->userImage.smoothScale(48,48); 273 // adduserDialog->userImage=adduserDialog->userImage.smoothScale(48,48);
274 adduserDialog->userImage.save(filename,"PNG"); 274 adduserDialog->userImage.save(filename,"PNG");
275 } 275 }
276 276
277 // Should we copy the skeleton homedirectory /etc/skel to the user's homedirectory? 277 // Should we copy the skeleton homedirectory /etc/skel to the user's homedirectory?
278 accounts->findUser(adduserDialog->loginLineEdit->text()); 278 accounts->findUser(adduserDialog->loginLineEdit->text());
279 if(adduserDialog->skelCheckBox->isChecked()) 279 if(adduserDialog->skelCheckBox->isChecked())
280 { 280 {
281 QString command_cp; 281 QString command_cp;
282 QString command_chown; 282 QString command_chown;
283 command_cp.sprintf("cp -a /etc/skel/* %s/",accounts->pw_dir.latin1()); 283 command_cp.sprintf("cp -a /etc/skel/* %s/",accounts->pw_dir.latin1());
284 system(command_cp); 284 system(command_cp);
285 285
286 command_cp.sprintf("cp -a /etc/skel/.[!.]* %s/",accounts->pw_dir.latin1()); // Bug in busybox, ".*" includes parent directory, does this work as a workaround? 286 command_cp.sprintf("cp -a /etc/skel/.[!.]* %s/",accounts->pw_dir.latin1()); // Bug in busybox, ".*" includes parent directory, does this work as a workaround?
287 system(command_cp); 287 system(command_cp);
288 288
289 command_chown.sprintf("chown -R %d:%d %s",accounts->pw_uid,accounts->pw_gid,accounts->pw_dir.latin1()); 289 command_chown.sprintf("chown -R %d:%d %s",accounts->pw_uid,accounts->pw_gid,accounts->pw_dir.latin1());
290 system(command_chown); 290 system(command_chown);
291 } 291 }
292 292
293 return true; 293 return true;
294} 294}
295 295
296/** 296/**
@@ -415,53 +415,53 @@ bool UserDialog::editUser(const char *username)
415 accounts->pw_gecos=edituserDialog->gecosLineEdit->text(); 415 accounts->pw_gecos=edituserDialog->gecosLineEdit->text();
416 accounts->pw_shell=edituserDialog->shellComboBox->currentText(); 416 accounts->pw_shell=edituserDialog->shellComboBox->currentText();
417 // Update userinfo, using the information stored in the user variables stored in the accounts object. 417 // Update userinfo, using the information stored in the user variables stored in the accounts object.
418 accounts->updateUser(username); 418 accounts->updateUser(username);
419 419
420 // Remove user from all groups he/she is a member of. (could be done in a better way I guess, this was simple though.) 420 // Remove user from all groups he/she is a member of. (could be done in a better way I guess, this was simple though.)
421 for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) 421 for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it)
422 { 422 {
423 accounts->delGroupMember((*it).left((*it).find(":")),username); 423 accounts->delGroupMember((*it).left((*it).find(":")),username);
424 } 424 }
425 425
426 // Add User to additional groups that he/she is a member of. 426 // Add User to additional groups that he/she is a member of.
427 QListViewItemIterator it( edituserDialog->groupsListView ); 427 QListViewItemIterator it( edituserDialog->groupsListView );
428 for ( ; it.current(); ++it ) 428 for ( ; it.current(); ++it )
429 { 429 {
430 temp=(QCheckListItem*)it.current(); 430 temp=(QCheckListItem*)it.current();
431 if ( temp->isOn() ) 431 if ( temp->isOn() )
432 accounts->addGroupMember(it.current()->text(0),edituserDialog->loginLineEdit->text()); 432 accounts->addGroupMember(it.current()->text(0),edituserDialog->loginLineEdit->text());
433 } 433 }
434 434
435 // Copy image to pics/users/ 435 // Copy image to pics/users/
436 if(!(edituserDialog->userImage.isNull())) 436 if(!(edituserDialog->userImage.isNull()))
437 { 437 {
438 QDir d; 438 QDir d;
439 if(!(d.exists("/opt/QtPalmtop/pics/users"))) 439 if(!(d.exists(QPEApplication::qpeDir()+"pics/users")))
440 { 440 {
441 d.mkdir("/opt/QtPalmtop/pics/users"); 441 d.mkdir(QPEApplication::qpeDir()+"pics/users");
442 } 442 }
443 QString filename="/opt/QtPalmtop/pics/users/"+accounts->pw_name+".png"; 443 QString filename=QPEApplication::qpeDir()+"pics/users/"+accounts->pw_name+".png";
444 // edituserDialog->userImage=edituserDialog->userImage.smoothScale(48,48); 444 // edituserDialog->userImage=edituserDialog->userImage.smoothScale(48,48);
445 edituserDialog->userImage.save(filename,"PNG"); 445 edituserDialog->userImage.save(filename,"PNG");
446 } 446 }
447 return true; 447 return true;
448} 448}
449 449
450/** 450/**
451 * "OK" has been clicked. Verify some information before closing the dialog. 451 * "OK" has been clicked. Verify some information before closing the dialog.
452 * 452 *
453 */ 453 */
454void UserDialog::accept() 454void UserDialog::accept()
455{ 455{
456 // Add checking... valid username? username taken? 456 // Add checking... valid username? username taken?
457 if(loginLineEdit->text().isEmpty()) 457 if(loginLineEdit->text().isEmpty())
458 { 458 {
459 QMessageBox::information(0,"Empty Login","Please enter a login."); 459 QMessageBox::information(0,"Empty Login","Please enter a login.");
460 return; 460 return;
461 } 461 }
462 QDialog::accept(); 462 QDialog::accept();
463} 463}
464 464
465/** 465/**
466 * This slot is called when the usericon is clicked, this loads (should) the iconselector. 466 * This slot is called when the usericon is clicked, this loads (should) the iconselector.
467 * 467 *