00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "desktop.h"
00022 #include <X11/Xcms.h>
00023 #include <X11/extensions/scrnsaver.h>
00024
00025 namespace SaX {
00026
00027
00028
00029 SaXManipulateDesktop::SaXManipulateDesktop (
00030 SaXImport* desktop, SaXImport* card , SaXImport* path, int desktopID
00031 ) {
00032
00035
00036 if ( (! desktop) || (! card) ) {
00037 excNullPointerArgument ();
00038 qError (errorString(),EXC_NULLPOINTERARGUMENT);
00039 return;
00040 }
00041 if ( desktop->getSectionID() != SAX_DESKTOP ) {
00042 excDesktopImportBindFailed ( desktop->getSectionID() );
00043 qError (errorString(),EXC_DESKTOPIMPORTBINDFAILED);
00044 return;
00045 }
00046 if ( card->getSectionID() != SAX_CARD ) {
00047 excCardImportBindFailed ( card->getSectionID() );
00048 qError (errorString(),EXC_CARDIMPORTBINDFAILED);
00049 return;
00050 }
00051 if ( path->getSectionID() != SAX_PATH ) {
00052 excPathImportBindFailed ( path->getSectionID() );
00053 qError (errorString(),EXC_PATHIMPORTBINDFAILED);
00054 return;
00055 }
00056 mDesktopID = desktopID;
00057 mDesktop = desktop;
00058 mCard = card;
00059 mPath = path;
00060 mDesktop -> setID ( mDesktopID );
00061 mCard -> setID ( mDesktopID );
00062 mPath -> setID ( 0 );
00063 mCDBMonitors = 0;
00064 mSyspDesktop = 0;
00065 }
00066
00067
00068
00069
00070 bool SaXManipulateDesktop::selectDesktop (int desktop) {
00071
00074
00075 if ((! mDesktop) || (! mCard) || (! mPath)) {
00076 return false;
00077 }
00078 if ( (mDesktop->setID (desktop)) && (mCard->setID (desktop)) ) {
00079 mDesktopID = desktop;
00080 return true;
00081 }
00082 return false;
00083 }
00084
00085
00086
00087
00088 void SaXManipulateDesktop::calculateModelines (bool calc) {
00089
00093
00094 if ((! mDesktop) || (! mCard) || (! mPath)) {
00095 return;
00096 }
00097 QString val ("no");
00098 if (calc) {
00099 val = "on";
00100 }
00101 mDesktop -> setItem ( "CalcModelines",val );
00102 }
00103
00104
00105
00106
00107 void SaXManipulateDesktop::setResolution (int c,int x,int y) {
00108
00111
00112 if ((! mDesktop) || (! mCard) || (! mPath)) {
00113 return;
00114 }
00115 QString key;
00116 QString val;
00117 key.sprintf ("Modes:%d",c);
00118 val.sprintf ("%dx%d",x,y);
00119 mDesktop -> setItem ( key,val );
00120 }
00121
00122
00123
00124
00125 void SaXManipulateDesktop::addResolution (int c,int x,int y) {
00126
00129
00130 if ((! mDesktop) || (! mCard) || (! mPath)) {
00131 return;
00132 }
00133 QString key;
00134 QString val;
00135 key.sprintf ("Modes:%d",c);
00136 if (! mDesktop -> getItem (key).isEmpty()) {
00137 val = mDesktop -> getItem (key);
00138 }
00139 QTextOStream (&val) << "," << x << "x" << y;
00140 val.replace (QRegExp("^,"),"");
00141 mDesktop -> setItem ( key,val );
00142 }
00143
00144
00145
00146
00147 void SaXManipulateDesktop::removeResolution (int c,int x,int y) {
00148
00151
00152 if ((! mDesktop) || (! mCard) || (! mPath)) {
00153 return;
00154 }
00155 QString key;
00156 QString val;
00157 key.sprintf ("Modes:%d",c);
00158 val.sprintf ("%dx%d",x,y);
00159 if (! mDesktop -> getItem (key).isEmpty()) {
00160 mDesktop -> removeItem (key,val);
00161 }
00162 }
00163
00164
00165
00166
00167 void SaXManipulateDesktop::setVirtualResolution (int c,int x,int y) {
00168
00171
00172 if ((! mDesktop) || (! mCard) || (! mPath)) {
00173 return;
00174 }
00175 QString key;
00176 QString val;
00177 key.sprintf ("Virtual:%d",c);
00178 val.sprintf ("%d %d",x,y);
00179 mDesktop -> setItem ( key,val );
00180 }
00181
00182
00183
00184
00185 void SaXManipulateDesktop::removeVirtualResolution (int c) {
00186
00189
00190 if ((! mDesktop) || (! mCard) || (! mPath)) {
00191 return;
00192 }
00193 QString key;
00194 key.sprintf ("Virtual:%d",c);
00195 if (! mDesktop -> getItem (key).isEmpty()) {
00196 mDesktop -> setItem (key,"");
00197 }
00198 }
00199
00200
00201
00202
00203 void SaXManipulateDesktop::setColorDepth (int c) {
00204
00207
00208 if ((! mDesktop) || (! mCard) || (! mPath)) {
00209 return;
00210 }
00211 QString color;
00212 color.sprintf ("%d",c);
00213 mDesktop -> setItem ( "ColorDepth",color );
00214 }
00215
00216
00217
00218
00219 bool SaXManipulateDesktop::is3DCard (void) {
00220
00223
00224 if ((! mDesktop) || (! mCard) || (! mPath)) {
00225 return false;
00226 }
00227
00228
00229
00230 SaXImportSysp* pCard = new SaXImportSysp (SYSP_CARD);
00231 pCard -> doImport();
00232 if (! pCard -> setID ( mDesktopID )) {
00233 return false;
00234 }
00235 QString mCardName;
00236 QTextOStream (&mCardName) <<
00237 pCard->getItem("Vendor") << ":" << pCard->getItem("Device");
00238
00239
00240
00241 SaXProcess* CDBCards = new SaXProcess ();
00242 CDBCards -> start (CDB_CARDS);
00243 Q3Dict< Q3Dict<QString> > CDBData = CDBCards -> getTablePointerCDB ();
00244 Q3Dict<QString>* cardData = CDBData.find( mCardName );
00245 if ( cardData ) {
00246 QString* flag = cardData -> find ("Flag");
00247 if (flag) {
00248 QString driver = mCard -> getItem ("Driver");
00249 QString* driver3D = cardData -> find ("3DDriver");
00250 if ((driver3D) && (driver == *driver3D)) {
00251
00252
00253
00254 if ( driver == "nvidia") {
00255 QString vendor = getVendorForDriver ( driver );
00256 if (vendor == "NVIDIA Corporation") {
00257 return true;
00258 }
00259 return false;
00260 }
00261 return true;
00262 }
00263 return false;
00264 }
00265 return false;
00266 }
00267
00268
00269
00270 excEmptyCDBGroup ( mCardName.latin1() );
00271 qError (errorString(),EXC_EMPTYCDBGROUP);
00272 return false;
00273 }
00274
00275
00276
00277
00278 QString SaXManipulateDesktop::getDualHeadProfile ( void ) {
00279
00285
00286 if ((! mDesktop) || (! mCard) || (! mPath)) {
00287 QString* nope = new QString;
00288 return *nope;
00289 }
00290
00291
00292
00293 Q3Dict<QString> metaData = getMetaData();
00294 if (metaData["SAX_NO_CDB_CHECK"]) {
00295 QString driver = mCard -> getItem ("Driver");
00296 QString profile = getDriverOptionsDualHeadProfile ( driver );
00297 return profile;
00298 }
00299
00300
00301
00302 QString result;
00303 SaXManipulateCard cardInfo (mCard);
00304 if (cardInfo.isNoteBook()) {
00305 QString driver = mCard -> getItem ("Driver");
00306 result = getDriverOptionsDualHeadProfile ( driver );
00307 return result;
00308 }
00309
00310
00311
00312 SaXImportSysp* pCard = new SaXImportSysp (SYSP_CARD);
00313 pCard -> doImport();
00314 if (! pCard -> setID ( mDesktopID )) {
00315 QString* nope = new QString;
00316 return *nope;
00317 }
00318 QString mCardName;
00319 QTextOStream (&mCardName) <<
00320 pCard->getItem("Vendor") << ":" << pCard->getItem("Device");
00321
00322
00323
00324 SaXProcess* CDBCards = new SaXProcess ();
00325 CDBCards -> start (CDB_CARDS);
00326 Q3Dict< Q3Dict<QString> > CDBData = CDBCards -> getTablePointerCDB ();
00327 Q3Dict<QString>* cardData = CDBData.find ( mCardName );
00328 if ( cardData ) {
00329 QString* profile = cardData -> find ("Profile");
00330 if ((profile) && (profile->contains("DualHead_DriverOptions"))) {
00331
00332
00333
00334 QString syspDriver = pCard -> getItem ("Module");
00335 QString* CDB2DDriver = cardData -> find ("Driver");
00336 QString* CDB3DDriver = cardData -> find ("3DDriver");
00337 if (
00338 ((CDB2DDriver) && (syspDriver == *CDB2DDriver)) ||
00339 ((CDB3DDriver) && (syspDriver == *CDB2DDriver))
00340 ) {
00341 QTextOStream (&result) << PROFILE_DIR << profile;
00342 return result;
00343 }
00344
00345
00346
00347 result = getDriverOptionsDualHeadProfile ( syspDriver );
00348 return result;
00349 }
00350 }
00351
00352
00353
00354 excEmptyCDBGroup ( mCardName.latin1() );
00355 qError (errorString(),EXC_EMPTYCDBGROUP);
00356 QString* nope = new QString;
00357 return *nope;
00358 }
00359
00360
00361
00362
00363 bool SaXManipulateDesktop::isXineramaMode (void) {
00364
00365
00366
00367
00368
00369 Q3Dict<QString> metaData = getMetaData();
00370 if (metaData["SAX_NO_DUAL_MODE"]) {
00371 return true;
00372 }
00373 return false;
00374 }
00375
00376
00377
00378
00379 bool SaXManipulateDesktop::isDualHeadCard (void) {
00380
00384
00385 if ((! mDesktop) || (! mCard) || (! mPath)) {
00386 return false;
00387 }
00388
00389
00390
00391 Q3Dict<QString> metaData = getMetaData();
00392 if (metaData["SAX_NO_CDB_CHECK"]) {
00393 QString driver = mCard -> getItem ("Driver");
00394 QString profile = getDriverOptionsDualHeadProfile ( driver );
00395 if (! profile.isEmpty()) {
00396 return true;
00397 }
00398 return false;
00399 }
00400
00401
00402
00403 SaXImportSysp* pCard = new SaXImportSysp (SYSP_CARD);
00404 pCard -> doImport();
00405 if (! pCard -> setID ( mDesktopID )) {
00406 return false;
00407 }
00408 QString mCardName;
00409 QTextOStream (&mCardName) <<
00410 pCard->getItem("Vendor") << ":" << pCard->getItem("Device");
00411
00412
00413
00414 SaXProcess* CDBCards = new SaXProcess ();
00415 CDBCards -> start (CDB_CARDS);
00416 Q3Dict< Q3Dict<QString> > CDBData = CDBCards -> getTablePointerCDB ();
00417 Q3Dict<QString>* cardData = CDBData.find ( mCardName );
00418 if ( cardData ) {
00419 QString* profile = cardData -> find ("Profile");
00420 if ((profile) && (profile->contains("DualHead_DriverOptions"))) {
00421
00422
00423
00424 QString syspDriver = pCard -> getItem ("Module");
00425 QString* CDB2DDriver = cardData -> find ("Driver");
00426 QString* CDB3DDriver = cardData -> find ("3DDriver");
00427 if (
00428 ((CDB2DDriver) && (syspDriver != *CDB2DDriver)) &&
00429 ((CDB3DDriver) && (syspDriver != *CDB2DDriver))
00430 ) {
00431 *profile = getDriverOptionsDualHeadProfile ( syspDriver );
00432 }
00433 if (profile->isEmpty()) {
00434 return false;
00435 }
00436
00437
00438
00439 SaXProcessCall* proc = new SaXProcessCall ();
00440 proc -> addArgument ( SAX_PROFILE_CHECK );
00441 proc -> addArgument ( *profile );
00442 if ( ! proc -> start() ) {
00443 excProcessFailed();
00444 qError (errorString(),EXC_PROCESSFAILED);
00445 return false;
00446 }
00447 if (proc->exitStatus() == 0) {
00448 return true;
00449 }
00450 return false;
00451 }
00452 return false;
00453 }
00454
00455
00456
00457 excEmptyCDBGroup ( mCardName.latin1() );
00458 qError (errorString(),EXC_EMPTYCDBGROUP);
00459 return false;
00460 }
00461
00462
00463
00464
00465 bool SaXManipulateDesktop::enable3D (void) {
00466
00475
00476 if ((! mDesktop) || (! mCard) || (! mPath)) {
00477 return false;
00478 }
00479
00480
00481
00482 SaXImportSysp* pCard = new SaXImportSysp (SYSP_CARD);
00483 pCard -> doImport();
00484 if (! pCard -> setID ( mDesktopID )) {
00485 return false;
00486 }
00487 QString mCardName;
00488 QTextOStream (&mCardName) <<
00489 pCard->getItem("Vendor") << ":" << pCard->getItem("Device");
00490
00491
00492
00493
00494 SaXProcess* CDBCards = new SaXProcess ();
00495 CDBCards -> start (CDB_CARDS);
00496 Q3Dict< Q3Dict<QString> > CDBData = CDBCards -> getTablePointerCDB ();
00497
00498
00499
00500
00501 SaXManipulateCard cardInfo (mCard,mDesktopID);
00502 Q3Dict<QString>* cardData = CDBData.find ( mCardName );
00503 if ( cardData ) {
00504 QString* driver3D= cardData -> find ("3DDriver");
00505 QString* driver2D= cardData -> find ("Driver");
00506 QString* extends = cardData -> find ("Extension");
00507 QString* flag = cardData -> find ("Flag");
00508
00509
00510
00511 if (! flag) {
00512 return false;
00513 }
00514
00515
00516
00517 if ((driver3D) && (*driver3D == "nvidia")) {
00518 bool foundBinaryNVidiaDriver = false;
00519 if ((getVendorForDriver(*driver3D)) == "NVIDIA Corporation") {
00520 foundBinaryNVidiaDriver = true;
00521 }
00522 if (! foundBinaryNVidiaDriver) {
00523 excNvidiaDriverMissing();
00524 qError (errorString(),EXC_NVIDIADRIVERMISSING);
00525 return false;
00526 }
00527 }
00528
00529
00530
00531 if (extends) {
00532 SaXManipulatePath pathInfo (mPath);
00533 pathInfo.removeLoadableModule (*extends);
00534 pathInfo.addLoadableModule (*extends);
00535 }
00536
00537
00538
00539 if (driver3D) {
00540 QString currentDriver = cardInfo.getCardDriver();
00541 if ((currentDriver != *driver3D) && (currentDriver != *driver2D)) {
00542 excDriverMismatch (driver3D->ascii(),currentDriver.ascii());
00543 qError (errorString(),EXC_DRIVERMISMATCH);
00544 } else {
00545 cardInfo.setCardDriver (*driver3D);
00546 }
00547 }
00548 }
00549
00550
00551
00552 if (cardData) {
00553 QStringList profiles;
00554 QString* profile3D = cardData -> find ("3DProfile");
00555 QString* driver3D = cardData -> find ("3DDriver");
00556 QString* driver2D = cardData -> find ("Driver");
00557 if ((profile3D) && (! profile3D->contains("DualHead"))) {
00558 profiles += *profile3D;
00559 }
00560 if ((driver3D) && (*driver2D != *driver3D)) {
00561 SaXFile mapHandle (MAP_DIR + QString("Driver.map"));
00562 Q3Dict<QString> driverMap = mapHandle.readDict();
00563 QString driver = cardInfo.getCardDriver();
00564 if ((! driver.isEmpty()) && (driverMap[driver])) {
00565 QStringList items = QStringList::split ( ",", *driverMap[driver] );
00566 profiles += items;
00567 }
00568 }
00569 for (
00570 QStringList::Iterator it=profiles.begin();
00571 it != profiles.end(); ++it
00572 ) {
00573 QString profile (*it);
00574 SaXImportProfile* pProfile = new SaXImportProfile (
00575 PROFILE_DIR + profile
00576 );
00577 pProfile -> doImport();
00578
00579
00580
00581 SaXImport* mImportCard = pProfile -> getImport ( SAX_CARD );
00582 if ( mImportCard ) {
00583 Q3Dict<QString> profileDriverOptions;
00584 SaXManipulateCard saxProfileCard ( mImportCard );
00585 profileDriverOptions = saxProfileCard.getOptions();
00586 Q3DictIterator<QString> it ( profileDriverOptions );
00587 for (; it.current(); ++it) {
00588 QString key = it.currentKey();
00589 QString val = *it.current();
00590 cardInfo.addCardOption (key,val);
00591 }
00592 }
00593
00594
00595
00596 SaXImport* mImportDesktop = pProfile -> getImport ( SAX_DESKTOP );
00597 if ( mImportDesktop ) {
00598 Q3Dict<QString> profileDriverOptions;
00599 SaXManipulateDesktop saxProfileDesktop (
00600 mImportDesktop,mCard,mPath
00601 );
00602
00603
00604
00605 QString color = saxProfileDesktop.getColorDepth();
00606 if (! color.isEmpty()) {
00607 setColorDepth (color.toInt());
00608 }
00609 }
00610 }
00611 return true;
00612 }
00613
00614
00615
00616 excEmptyCDBGroup ( mCardName.latin1() );
00617 qError (errorString(),EXC_EMPTYCDBGROUP);
00618 return false;
00619 }
00620
00621
00622
00623
00624 bool SaXManipulateDesktop::disable3D (void) {
00625
00631
00632 if ((! mDesktop) || (! mCard) || (! mPath)) {
00633 return false;
00634 }
00635
00636
00637
00638 SaXImportSysp* pCard = new SaXImportSysp (SYSP_CARD);
00639 pCard -> doImport();
00640 if (! pCard -> setID ( mDesktopID )) {
00641 return false;
00642 }
00643 QString mCardName;
00644 QTextOStream (&mCardName) <<
00645 pCard->getItem("Vendor") << ":" << pCard->getItem("Device");
00646
00647
00648
00649
00650 SaXProcess* CDBCards = new SaXProcess ();
00651 CDBCards -> start (CDB_CARDS);
00652 Q3Dict< Q3Dict<QString> > CDBData = CDBCards -> getTablePointerCDB ();
00653
00654
00655
00656
00657 SaXManipulateCard cardInfo (mCard);
00658 Q3Dict<QString>* cardData = CDBData.find ( mCardName );
00659 if ( cardData ) {
00660 QString* driver3D= cardData -> find ("3DDriver");
00661 QString* driver2D= cardData -> find ("Driver");
00662 QString* extends = cardData -> find ("Extension");
00663 QString* flag = cardData -> find ("Flag");
00664
00665
00666
00667 if (! flag) {
00668 return false;
00669 }
00670
00671
00672
00673 if ((driver3D) && (*driver3D == "nvidia")) {
00674 if ((getVendorForDriver(*driver3D)) == "NVIDIA Corporation") {
00675 excNvidiaDriverInstalled();
00676 qError (errorString(),EXC_NVIDIADRIVERINSTALLED);
00677 return false;
00678 }
00679 }
00680
00681
00682
00683 if (extends) {
00684 SaXManipulatePath pathInfo (mPath);
00685 pathInfo.removeLoadableModule (*extends);
00686 }
00687
00688
00689
00690 if ((driver2D) && (driver3D)) {
00691 QString currentDriver = cardInfo.getCardDriver();
00692 if ((currentDriver != *driver3D) && (currentDriver != *driver2D)) {
00693 excDriverMismatch (driver2D->ascii(),currentDriver.ascii());
00694 qError (errorString(),EXC_DRIVERMISMATCH);
00695 } else {
00696 cardInfo.setCardDriver (*driver2D);
00697 }
00698 }
00699 }
00700
00701
00702
00703 if (cardData) {
00704 QStringList profiles;
00705 QString* profile3D = cardData -> find ("3DProfile");
00706 QString* driver3D = cardData -> find ("3DDriver");
00707 QString* driver2D = cardData -> find ("Driver");
00708 if ((profile3D) && (! profile3D->contains("DualHead"))) {
00709 profiles += *profile3D;
00710 }
00711 if ((driver3D) && (*driver2D != *driver3D)) {
00712 SaXFile mapHandle (MAP_DIR + QString("Driver.map"));
00713 Q3Dict<QString> driverMap = mapHandle.readDict();
00714 if ((driver3D) && (driverMap[*driver3D])) {
00715 QStringList items = QStringList::split ( ",",*driverMap[*driver3D] );
00716 profiles += items;
00717 }
00718 }
00719 for (
00720 QStringList::Iterator it=profiles.begin();
00721 it != profiles.end(); ++it
00722 ) {
00723 QString profile (*it);
00724 SaXImportProfile* pProfile = new SaXImportProfile (
00725 PROFILE_DIR + profile
00726 );
00727 pProfile -> doImport();
00728
00729
00730
00731 SaXImport* mImportCard = pProfile -> getImport ( SAX_CARD );
00732 if ( mImportCard ) {
00733 Q3Dict<QString> profileDriverOptions;
00734 SaXManipulateCard saxProfileCard ( mImportCard );
00735 profileDriverOptions = saxProfileCard.getOptions();
00736 Q3DictIterator<QString> it ( profileDriverOptions );
00737 for (; it.current(); ++it) {
00738 QString key = it.currentKey();
00739 cardInfo.removeCardOption (key);
00740 }
00741 }
00742 }
00743 return true;
00744 }
00745
00746
00747
00748 excEmptyCDBGroup ( mCardName.latin1() );
00749 qError (errorString(),EXC_EMPTYCDBGROUP);
00750 return false;
00751 }
00752
00753
00754
00755
00756 void SaXManipulateDesktop::setDisplaySize (int width,int height) {
00757
00760
00761 if ((! mDesktop) || (! mCard) || (! mPath)) {
00762 return;
00763 }
00764 QString size;
00765 size.sprintf ("%d %d",width,height);
00766 mDesktop -> setItem ( "DisplaySize",size );
00767 }
00768
00769
00770
00771
00772 void SaXManipulateDesktop::setDisplayRatioAndTraversal (
00773 double traversal,int aspect, int ratio
00774 ) {
00775
00778
00779 if ((! mDesktop) || (! mCard) || (! mPath)) {
00780 return;
00781 }
00782 traversal = traversal * 25.4;
00783 double ar = (double)aspect / (double)ratio;
00784 double y = sqrt ( (traversal * traversal) / (ar * ar + 1.0) );
00785 double x = ar * y;
00786 setDisplaySize (
00787 (int)(round(x)),(int)(round(y))
00788 );
00789 }
00790
00791
00792
00793
00794 void SaXManipulateDesktop::setHsyncRange (double hsmin,double hsmax) {
00795
00798
00799 if ((! mDesktop) || (! mCard) || (! mPath)) {
00800 return;
00801 }
00802 QString range;
00803 range.sprintf ("%.0f-%.0f",hsmin,hsmax);
00804 mDesktop -> setItem ( "HorizSync",range );
00805 }
00806
00807
00808
00809
00810 void SaXManipulateDesktop::setVsyncRange (double vsmin,double vsmax) {
00811
00814
00815 if ((! mDesktop) || (! mCard) || (! mPath)) {
00816 return;
00817 }
00818 QString range;
00819 range.sprintf ("%.0f-%.0f",vsmin,vsmax);
00820 mDesktop -> setItem ( "VertRefresh",range );
00821 }
00822
00823
00824
00825
00826 void SaXManipulateDesktop::setPreferredMode (const QString& mode) {
00827
00830
00831 if ((! mDesktop) || (! mCard) || (! mPath)) {
00832 return;
00833 }
00834 mDesktop -> setItem ( "PreferredMode",mode);
00835 }
00836
00837
00838
00839
00840 void SaXManipulateDesktop::enableDPMS (void) {
00841
00845
00846 if ((! mDesktop) || (! mCard) || (! mPath)) {
00847 return;
00848 }
00849 mDesktop -> setItem ( "MonitorOptions","DPMS" );
00850 }
00851
00852
00853
00854
00855 void SaXManipulateDesktop::disableDPMS (void) {
00856
00859
00860 if ((! mDesktop) || (! mCard) || (! mPath)) {
00861 return;
00862 }
00863 mDesktop -> setItem ( "MonitorOptions","" );
00864 }
00865
00866
00867
00868
00869 void SaXManipulateDesktop::setMonitorVendor (const QString& vendor) {
00870
00873
00874 if ((! mDesktop) || (! mCard) || (! mPath)) {
00875 return;
00876 }
00877 mDesktop -> setItem ( "VendorName",vendor );
00878 }
00879
00880
00881
00882
00883 void SaXManipulateDesktop::setMonitorName (const QString& name) {
00884
00887
00888 if ((! mDesktop) || (! mCard) || (! mPath)) {
00889 return;
00890 }
00891 mDesktop -> setItem ( "ModelName",name );
00892 }
00893
00894
00895
00896
00897 bool SaXManipulateDesktop::is3DEnabled (void) {
00898
00903
00904 if ((! mDesktop) || (! mCard) || (! mPath)) {
00905 return false;
00906 }
00907 if ( mCard -> getCount() > 1 ) {
00908 return false;
00909 }
00910 QString driver = mCard -> getItem ("Driver");
00911 if (driver == "nvidia") {
00912 QString vendor = getVendorForDriver ( driver );
00913 if (vendor == "NVIDIA Corporation") {
00914 return true;
00915 }
00916 return false;
00917 }
00918 SaXManipulatePath pathInfo (mPath);
00919 QList<QString> modules = pathInfo.getModules();
00920 QString it;
00921 foreach (it,modules) {
00922 if (it == "dri") {
00923 return true;
00924 }
00925 }
00926 return false;
00927 }
00928
00929
00930
00931
00932 QList<QString> SaXManipulateDesktop::getResolutions (int color) {
00933
00937
00938 if ((! mDesktop) || (! mCard) || (! mPath)) {
00939 QList<QString>* nope = new QList<QString>;
00940 return *nope;
00941 }
00942 QString modes;
00943 modes.sprintf ("Modes:%d",color);
00944 QString resolutions = mDesktop -> getItem (modes);
00945 if (resolutions.isEmpty()) {
00946 QList<QString>* nope = new QList<QString>;
00947 return *nope;
00948 }
00949 QList<QString> result;
00950 QStringList resList = QStringList::split ( ",", resolutions );
00951 for (QStringList::Iterator it=resList.begin(); it!=resList.end();++ it) {
00952 result.append (*it);
00953 }
00954 return result;
00955 }
00956
00957
00958
00959
00960 QList<QString> SaXManipulateDesktop::getResolutionFromServer ( void ) {
00961
00966
00967 if ((! mDesktop) || (! mCard) || (! mPath)) {
00968 QList<QString>* nope = new QList<QString>;
00969 return *nope;
00970 }
00971 QList<QString> defaultList;
00972 defaultList.append (QString("800x600"));
00973 SaXProcessCall* proc = new SaXProcessCall();
00974 proc -> addArgument ( XQUERY );
00975 proc -> addArgument ( "-r" );
00976 if ( ! proc -> start() ) {
00977 return defaultList;
00978 }
00979 QList<QString> data = proc->readStdout();
00980 QString in;
00981 foreach (in,data) {
00982 QRegExp modeExp ("(\\d+) (.*)");
00983 int rpos = modeExp.search (in,0);
00984 if (rpos >= 0) {
00985 int id = modeExp.cap(1).toInt();
00986 if (id == mDesktopID) {
00987 QList<QString> result;
00988 result.append (QString (modeExp.cap(2)));
00989 return result;
00990 }
00991 }
00992 }
00993 return defaultList;
00994 }
00995
00996
00997
00998
00999 int SaXManipulateDesktop::getColorDepthFromServer (void) {
01000 Display* dpy = XOpenDisplay (0);
01001 return DisplayPlanes( dpy,0 );
01002 }
01003
01004
01005
01006
01007 int SaXManipulateDesktop::getFBKernelMode (const QString& res,int depth) {
01008 if (! mSyspDesktop) {
01009 mSyspDesktop = new SaXImportSysp (SYSP_DESKTOP);
01010 }
01011 mSyspDesktop -> setID ( mDesktopID );
01012 mSyspDesktop -> doImport ();
01013 if ( mSyspDesktop->getItem("FBBoot").isNull()) {
01014 return 0;
01015 }
01016 QString val = mSyspDesktop->getItem("FBBoot");
01017 QStringList items = QStringList::split ( ",", val );
01018 for (
01019 QStringList::Iterator it=items.begin();
01020 it != items.end(); ++it
01021 ) {
01022 QString* resolution = new QString();
01023 QString mode (*it);
01024 QStringList record = QStringList::split ( " ", mode );
01025 QTextOStream (resolution) << record.at(0) << "x" << record.at(1);
01026 QString color = record.at(2);
01027 if ((*resolution == res) && (color.toInt() == depth)) {
01028 QString mode = record.at(3);
01029 return mode.toInt();
01030 }
01031 }
01032 return 0;
01033 }
01034
01035
01036
01037
01038 int SaXManipulateDesktop::setFBKernelMode (int mode) {
01039 QString* modeString = new QString();
01040 QTextOStream (modeString) << mode;
01041 SaXProcessCall* proc = new SaXProcessCall ();
01042 proc -> addArgument ( SAX_GRUB_UPDATE );
01043 proc -> addArgument ( *modeString );
01044 if ( ! proc -> start() ) {
01045 excProcessFailed();
01046 qError (errorString(),EXC_PROCESSFAILED);
01047 return false;
01048 }
01049 if (proc->exitStatus() == 0) {
01050 return true;
01051 }
01052 return false;
01053 }
01054
01055
01056
01057
01058 QList<QString> SaXManipulateDesktop::getResolutionsFromDDC (const QString& key) {
01059 QList<QString> result;
01060 Q3Dict<QString> hashed;
01061 SaXImportSysp* desktop = new SaXImportSysp (SYSP_DESKTOP);
01062 desktop -> setID ( mDesktopID );
01063 desktop -> doImport ();
01064 if ( desktop->getItem(key).isNull()) {
01065 QList<QString>* nope = new QList<QString>;
01066 return *nope;
01067 }
01068 if ((key != "FBBoot") && (desktop->getItem("DDC") == "<undefined>")) {
01069 QList<QString>* nope = new QList<QString>;
01070 return *nope;
01071 }
01072 QString val = desktop->getItem(key);
01073 QStringList items = QStringList::split ( ",", val );
01074 for (
01075 QStringList::Iterator it=items.begin();
01076 it != items.end(); ++it
01077 ) {
01078 QString* data = new QString();
01079 QString mode (*it);
01080 QStringList resolution = QStringList::split (" ", mode);
01081 QTextOStream (data) << resolution.at(0) << "x" << resolution.at(1);
01082 if (! hashed[*data]) {
01083 hashed.insert (*data,data);
01084 }
01085 }
01086 QString* default1 = new QString ("800x600");
01087 QString* default2 = new QString ("1024x768");
01088 hashed.insert (*default1,default1);
01089 hashed.insert (*default2,default2);
01090 Q3DictIterator<QString> ir (hashed);
01091 for (; ir.current(); ++ir) {
01092 result.append (*ir.current());
01093 }
01094 return result;
01095 }
01096
01097
01098
01099
01100 QList<QString> SaXManipulateDesktop::getResolutionsFromDDC1 (void) {
01101 return getResolutionsFromDDC ("Vesa");
01102 }
01103
01104
01105
01106
01107 QList<QString> SaXManipulateDesktop::getResolutionsFromDDC2 (void) {
01108 return getResolutionsFromDDC ("Vesa[2]");
01109 }
01110
01111
01112
01113
01114 QList<QString> SaXManipulateDesktop::getResolutionsFromFrameBuffer (void) {
01115 return getResolutionsFromDDC ("FBBoot");
01116 }
01117
01118
01119
01120
01121 QList<QString> SaXManipulateDesktop::getDisplaySize (void) {
01122
01128
01129 if ((! mDesktop) || (! mCard) || (! mPath)) {
01130 QList<QString>* nope = new QList<QString>;
01131 return *nope;
01132 }
01133 QString size = mDesktop -> getItem ("DisplaySize");
01134 if (size.isEmpty()) {
01135 QList<QString>* nope = new QList<QString>;
01136 return *nope;
01137 }
01138 QList<QString> result;
01139 QStringList sizeList = QStringList::split ( " ", size );
01140 result.append (
01141 QString(sizeList.first())
01142 );
01143 result.append (
01144 QString(sizeList.last())
01145 );
01146 return result;
01147 }
01148
01149
01150
01151
01152 QString SaXManipulateDesktop::getDisplayTraversal (void) {
01153
01156
01157 if ((! mDesktop) || (! mCard) || (! mPath)) {
01158 QString* nope = new QString;
01159 return *nope;
01160 }
01161 QList<QString> size = getDisplaySize();
01162 if (size.isEmpty()) {
01163 QString* nope = new QString;
01164 return *nope;
01165 }
01166 int x = size.at(0).toInt();
01167 int y = size.at(1).toInt();
01168 double traversal = sqrt (x*x + y*y) / 25.4;
01169 QString result;
01170 QTextOStream (&result) << traversal;
01171 return result;
01172 }
01173
01174
01175
01176
01177 QList<QString> SaXManipulateDesktop::getDisplayRatio (void) {
01178
01181
01182 if ((! mDesktop) || (! mCard) || (! mPath)) {
01183 QList<QString>* nope = new QList<QString>;
01184 return *nope;
01185 }
01186 QString* setX = new QString ("4");
01187 QString* setY = new QString ("3");
01188 QList<QString> result;
01189 QList<QString> size = getDisplaySize();
01190 if (size.isEmpty()) {
01191 QList<QString>* nope = new QList<QString>;
01192 return *nope;
01193 }
01194 int x = size.at(0).toInt();
01195 int y = size.at(1).toInt();
01196 double ar = (double)x / (double)y;
01197 if ( ar > 1.4 ) {
01198 *setX = "16";
01199 *setY = "10";
01200 } else if (( ar <= 1.4 ) && ( ar > 1.3 )) {
01201 *setX = "4";
01202 *setY = "3";
01203 } else if ( ar <= 1.3 ) {
01204 *setX = "5";
01205 *setY = "4";
01206 }
01207 result.append (*setX);
01208 result.append (*setY);
01209 return result;
01210 }
01211
01212
01213
01214
01215 QList<QString> SaXManipulateDesktop::getHsyncRange (void) {
01216
01220
01221 if ((! mDesktop) || (! mCard) || (! mPath)) {
01222 QList<QString>* nope = new QList<QString>;
01223 return *nope;
01224 }
01225 QString range = mDesktop -> getItem ("HorizSync");
01226 if (range.isEmpty()) {
01227 QList<QString>* nope = new QList<QString>;
01228 return *nope;
01229 }
01230 QList<QString> result;
01231 QStringList rangeList = QStringList::split ( "-", range );
01232 result.append (
01233 QString(rangeList.first())
01234 );
01235 result.append (
01236 QString(rangeList.last())
01237 );
01238 return result;
01239 }
01240
01241
01242
01243
01244 QList<QString> SaXManipulateDesktop::getVsyncRange (void) {
01245
01249
01250 if ((! mDesktop) || (! mCard) || (! mPath)) {
01251 QList<QString>* nope = new QList<QString>;
01252 return *nope;
01253 }
01254 QString range = mDesktop -> getItem ("VertRefresh");
01255 if (range.isEmpty()) {
01256 QList<QString>* nope = new QList<QString>;
01257 return *nope;
01258 }
01259 QList<QString> result;
01260 QStringList rangeList = QStringList::split ( "-", range );
01261 result.append (
01262 QString(rangeList.first())
01263 );
01264 result.append (
01265 QString(rangeList.last())
01266 );
01267 return result;
01268 }
01269
01270
01271
01272
01273 bool SaXManipulateDesktop::DPMSEnabled (void) {
01274
01278
01279 if ((! mDesktop) || (! mCard) || (! mPath)) {
01280 return false;
01281 }
01282 QString options = mDesktop -> getItem ("MonitorOptions");
01283 if (options == "DPMS") {
01284 return true;
01285 }
01286 return false;
01287 }
01288
01289
01290
01291
01292 QString SaXManipulateDesktop::getMonitorVendor (void) {
01293
01296
01297 if ((! mDesktop) || (! mCard) || (! mPath)) {
01298 QString* nope = new QString;
01299 return *nope;
01300 }
01301 return mDesktop -> getItem ("VendorName");
01302 }
01303
01304
01305
01306
01307 QString SaXManipulateDesktop::getMonitorName (void) {
01308
01311
01312 if ((! mDesktop) || (! mCard) || (! mPath)) {
01313 QString* nope = new QString;
01314 return *nope;
01315 }
01316 return mDesktop -> getItem ("ModelName");
01317 }
01318
01319
01320
01321
01322 QString SaXManipulateDesktop::getColorDepth (void) {
01323
01326
01327 if ((! mDesktop) || (! mCard) || (! mPath)) {
01328 QString* nope = new QString;
01329 return *nope;
01330 }
01331 return mDesktop -> getItem ("ColorDepth");
01332 }
01333
01334
01335
01336
01337 QString SaXManipulateDesktop::getModelineAlgorithm (void) {
01338
01340
01341 if ((! mDesktop) || (! mCard) || (! mPath)) {
01342 QString* nope = new QString;
01343 return *nope;
01344 }
01345 return mDesktop -> getItem ("CalcAlgorithm");
01346 }
01347
01348
01349
01350
01351 bool SaXManipulateDesktop::willCalculateModelines (void) {
01352
01355
01356 if ((! mDesktop) || (! mCard) || (! mPath)) {
01357 return false;
01358 }
01359 QString calculate = mDesktop -> getItem ("CalcModelines");
01360 if ((calculate == "on") || (calculate == "yes")) {
01361 return true;
01362 }
01363 return false;
01364 }
01365
01366
01367
01368
01369 QString SaXManipulateDesktop::getVirtualResolution (int color) {
01370
01374
01375 if ((! mDesktop) || (! mCard) || (! mPath)) {
01376 QString* nope = new QString;
01377 return *nope;
01378 }
01379 QString key;
01380 QString val;
01381 key.sprintf ("Virtual:%d",color);
01382 val = mDesktop -> getItem (key);
01383 if (val.isEmpty()) {
01384 QString* nope = new QString;
01385 return *nope;
01386 }
01387 QStringList resList = QStringList::split ( " ", val );
01388 QString result (resList.join("x"));
01389 return result;
01390 }
01391
01392
01393
01394
01395 void SaXManipulateDesktop::setCDBMonitor ( const QString& group ) {
01396
01400
01401 if ( ! mCDBMonitors ) {
01402 mCDBMonitors = new SaXProcess ();
01403 mCDBMonitors -> start (CDB_MONITORS);
01404 }
01405 Q3PtrList< Q3Dict<QString> > data;
01406 data = mCDBMonitors -> getTablePointerCDB_DATA (group);
01407 if (data.isEmpty()) {
01408 excCDBRecordNotFound (group);
01409 qError (errorString(),EXC_CDBRECORDNOTFOUND);
01410 return;
01411 }
01412 QStringList nameList = QStringList::split ( ":", group );
01413 setMonitorVendor ( nameList.first() );
01414 setMonitorName ( nameList.last() );
01415 mDesktop -> merge ( data );
01416 }
01417
01418
01419
01420
01421 QList<QString> SaXManipulateDesktop::getCDBMonitorVendorList ( void ) {
01422
01425
01426 mCDBMonitorList.clear();
01427 if ( ! mCDBMonitors ) {
01428 mCDBMonitors = new SaXProcess ();
01429 mCDBMonitors -> start (CDB_MONITORS);
01430 }
01431 Q3Dict< Q3Dict<QString> > CDBData = mCDBMonitors -> getTablePointerCDB ();
01432 Q3DictIterator< Q3Dict<QString> > it (CDBData);
01433 for (; it.current(); ++it) {
01434 QStringList vnlist = QStringList::split ( ":", it.currentKey() );
01435 QString* vendorName = new QString (vnlist.first());
01436 int hasVendor = false;
01437 QString io;
01438 foreach(io,mCDBMonitorList) {
01439 if (io == *vendorName ) {
01440 hasVendor = true;
01441 break;
01442 }
01443 }
01444 if (! hasVendor ) {
01445 mCDBMonitorList.append ( *vendorName );
01446 }
01447 }
01448 return mCDBMonitorList;
01449 }
01450
01451
01452
01453
01454 QList<QString> SaXManipulateDesktop::getCDBMonitorModelList (
01455 const QString& vendor
01456 ) {
01457
01460
01461 mCDBMonitorList.clear();
01462 if ( ! mCDBMonitors ) {
01463 mCDBMonitors = new SaXProcess ();
01464 mCDBMonitors -> start (CDB_MONITORS);
01465 }
01466 Q3Dict< Q3Dict<QString> > CDBData = mCDBMonitors -> getTablePointerCDB ();
01467 Q3DictIterator< Q3Dict<QString> > it (CDBData);
01468 for (; it.current(); ++it) {
01469 QStringList vnlist = QStringList::split ( ":", it.currentKey() );
01470 QString vendorName = vnlist.first();
01471 QString* modelName = new QString (vnlist.last());
01472 if ( vendorName == vendor ) {
01473 mCDBMonitorList.append ( *modelName );
01474 }
01475 }
01476 return mCDBMonitorList;
01477 }
01478
01479
01480
01481
01482 Q3Dict<QString> SaXManipulateDesktop::getCDBMonitorData (
01483 const QString& vendor, const QString& name
01484 ) {
01485
01488
01489 QString key;
01490 QTextOStream (&key) << vendor << ":" << name;
01491 mCDBMonitorData.clear();
01492 if ( ! mCDBMonitors ) {
01493 mCDBMonitors = new SaXProcess ();
01494 mCDBMonitors -> start (CDB_MONITORS);
01495 }
01496 Q3Dict< Q3Dict<QString> > CDBData = mCDBMonitors -> getTablePointerCDB ();
01497 Q3DictIterator< Q3Dict<QString> > it (CDBData);
01498 for (; it.current(); ++it) {
01499 if ( it.currentKey() == key ) {
01500 mCDBMonitorData = *it.current();
01501 break;
01502 }
01503 }
01504 return mCDBMonitorData;
01505 }
01506
01507
01508
01509 Q3Dict<QString> SaXManipulateDesktop::getCDBMonitorIDData (
01510 const QString& id
01511 ) {
01512
01515
01516 mCDBMonitorData.clear();
01517 if ( ! mCDBMonitors ) {
01518 mCDBMonitors = new SaXProcess ();
01519 mCDBMonitors -> start (CDB_MONITORS);
01520 }
01521 Q3Dict< Q3Dict<QString> > CDBData = mCDBMonitors -> getTablePointerCDB ();
01522 Q3DictIterator< Q3Dict<QString> > it (CDBData);
01523 bool found = false;
01524 for (; it.current(); ++it) {
01525 mCDBMonitorData = *it.current();
01526 if ((mCDBMonitorData["DDC"]) && (*mCDBMonitorData["DDC"] == id)) {
01527 mCDBMonitorData.insert ("Name",new QString(it.currentKey()));
01528 found = true;
01529 break;
01530 }
01531 }
01532 if (! found) {
01533 mCDBMonitorData.clear();
01534 }
01535 return mCDBMonitorData;
01536 }
01537
01538
01539
01540 void SaXManipulateDesktop::setCDBMonitorData (
01541 const QString& vendor, const QString& name,
01542 const QString& key, const QString& value
01543 ) {
01544
01549
01550 QString group;
01551 QTextOStream (&group) << vendor << ":" << name;
01552 if ( ! mCDBMonitors ) {
01553 mCDBMonitors = new SaXProcess ();
01554 mCDBMonitors -> start (CDB_MONITORS);
01555 }
01556 mCDBMonitors -> addGroup (
01557 group,key,value
01558 );
01559 }
01560
01561
01562
01563 QString SaXManipulateDesktop::getVendorForDriver ( const QString& driver ) {
01564
01567
01568 SaXProcessCall* proc = new SaXProcessCall ();
01569 proc -> addArgument ( SYSP_VENDOR );
01570 proc -> addArgument ( driver );
01571 if ( ! proc -> start() ) {
01572 excProcessFailed();
01573 qError (errorString(),EXC_PROCESSFAILED);
01574 }
01575 QList<QString> data = proc -> readStdout();
01576 return data.first();
01577 }
01578
01579
01580
01581 void SaXManipulateDesktop::setExtraModelineString (
01582 const QString & mode
01583 ) {
01584
01587
01588
01589 if ((! mDesktop) || (! mCard) || (! mPath)) {
01590 return;
01591 }
01592 mDesktop -> setItem ( "SpecialModeline",mode );
01593 }
01594
01595
01596
01597 void SaXManipulateDesktop::setExtraModeline (
01598 int x,int y,int refresh,int hsync
01599 ) {
01600
01604
01605 if ((! mDesktop) || (! mCard) || (! mPath)) {
01606 return;
01607 }
01608 QString mode = calculateModeline ( x,y,refresh,hsync );
01609 mDesktop -> setItem ( "SpecialModeline",mode );
01610 }
01611
01612
01613
01614 void SaXManipulateDesktop::addExtraModeline (
01615 int x,int y,int refresh,int hsync
01616 ) {
01617
01621
01622 if ((! mDesktop) || (! mCard) || (! mPath)) {
01623 return;
01624 }
01625 QString val;
01626 QString key = "SpecialModeline";
01627 QString mode = calculateModeline ( x,y,refresh,hsync );
01628 if (! mDesktop -> getItem (key).isEmpty()) {
01629 val = mDesktop -> getItem (key);
01630 }
01631 QTextOStream (&val) << "," << mode;
01632 val.replace (QRegExp("^,"),"");
01633 mDesktop -> setItem ( key,val );
01634 }
01635
01636
01637
01638 void SaXManipulateDesktop::removeExtraModeline ( int x,int y) {
01639
01642
01643 if ((! mDesktop) || (! mCard) || (! mPath)) {
01644 return;
01645 }
01646 QString val;
01647 QString key = "SpecialModeline";
01648 val.sprintf ("\"%dx%d\"",x,y);
01649 QString current = mDesktop -> getItem (key);
01650 QStringList lines = QStringList::split ( ",", current );
01651 for (
01652 QStringList::Iterator it=lines.begin();
01653 it != lines.end(); ++it
01654 ) {
01655 QString mode (*it);
01656 if (mode.contains (val)) {
01657 mDesktop -> removeItem (key,mode);
01658 }
01659 }
01660 }
01661
01662
01663
01664 QString SaXManipulateDesktop::calculateModeline (
01665 int x,int y,int refresh,int hsync
01666 ) {
01667
01671
01672 QString result;
01673 for (int r=refresh;r >= 50;r--) {
01674 SaXProcessCall* proc = new SaXProcessCall ();
01675 proc -> addArgument ( XMODE );
01676 proc -> addArgument ( "-x" );
01677 proc -> addArgument ( x );
01678 proc -> addArgument ( "-y" );
01679 proc -> addArgument ( y );
01680 proc -> addArgument ( "-r" );
01681 proc -> addArgument ( r + 2 );
01682 if ( ! proc -> start() ) {
01683 excProcessFailed();
01684 qError (errorString(),EXC_PROCESSFAILED);
01685 }
01686 QList<QString> data = proc->readStdout();
01687 int hs = data.at(0).toInt();
01688 result = *data.at(2);
01689 if (hs <= hsync) {
01690 break;
01691 }
01692 }
01693 result.replace (QRegExp("^Modeline "),"");
01694 return result;
01695 }
01696
01697
01698
01699 QString SaXManipulateDesktop::getDriverOptionsDualHeadProfile (
01700 const QString& driver
01701 ) {
01702
01706
01707 QString result;
01708 if ((driver == "i810") || (driver == "i915")) {
01709 QTextOStream (&result)
01710 << PROFILE_DIR << "Intel_DualHead_DriverOptions";
01711 }
01712 if (driver == "intel") {
01713 QTextOStream (&result)
01714 << PROFILE_DIR << "IntelNext_DualHead_DriverOptions";
01715 }
01716 if (driver == "nvidia") {
01717 QTextOStream (&result)
01718 << PROFILE_DIR << "NVidia_DualHead_DriverOptions";
01719 }
01720 if (driver == "radeonhd") {
01721 QTextOStream (&result)
01722 << PROFILE_DIR << "RadeonHD_DualHead_DriverOptions";
01723 }
01724 if (driver == "radeon") {
01725 QTextOStream (&result)
01726 << PROFILE_DIR << "Radeon_DualHead_DriverOptions";
01727 }
01728 if (driver == "fglrx") {
01729 QTextOStream (&result)
01730 << PROFILE_DIR << "FGLRX_DualHead_DriverOptions";
01731 }
01732 if (driver == "mga") {
01733 QTextOStream (&result)
01734 << PROFILE_DIR << "Matrox_DualHead_DriverOptions";
01735 }
01736 if (driver == "sis") {
01737 QTextOStream (&result)
01738 << PROFILE_DIR << "SiS_DualHead_DriverOptions";
01739 }
01740 return result;
01741 }
01742
01743
01744
01745 Q3Dict<QString> SaXManipulateDesktop::getMetaData ( void ) {
01746
01752 QString cardID;
01753 QTextOStream (&cardID) << mDesktopID;
01754 QList<const char*> metaOptions;
01755 metaOptions.append ((const char*) "-c" );
01756 metaOptions.append ( (const char*)cardID.latin1() );
01757 SaXProcess* proc = new SaXProcess ();
01758 proc->start ( metaOptions , SAX_META );
01759 Q3Dict<QString> metaData = proc->getCurrentTable();
01760 return metaData;
01761 }
01762 }