-rw-r--r-- | core/launcher/launcher.cpp | 82 |
1 files changed, 48 insertions, 34 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index 1449269..979eee6 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp | |||
@@ -97,7 +97,7 @@ namespace { | |||
97 | tmpMime = cfg->readBoolEntry("text", true ); | 97 | tmpMime = cfg->readBoolEntry("text", true ); |
98 | if(tmpMime ) | 98 | if(tmpMime ) |
99 | mimes.append("text//*"); | 99 | mimes.append("text//*"); |
100 | 100 | ||
101 | tmpMime = cfg->readBoolEntry("video", true ); | 101 | tmpMime = cfg->readBoolEntry("video", true ); |
102 | if(tmpMime ) | 102 | if(tmpMime ) |
103 | mimes.append("video//*" ); | 103 | mimes.append("video//*" ); |
@@ -549,10 +549,10 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global:: | |||
549 | delete tmp; | 549 | delete tmp; |
550 | // find out wich filesystems are new in this round | 550 | // find out wich filesystems are new in this round |
551 | // We will do this by having a timestamp inside each mountpoint | 551 | // We will do this by having a timestamp inside each mountpoint |
552 | // if the current timestamp doesn't match this is a new file system and | 552 | // if the current timestamp doesn't match this is a new file system and |
553 | // come up with our MediumMountGui :) let the hacking begin | 553 | // come up with our MediumMountGui :) let the hacking begin |
554 | int stamp = uidgen.generate(); | 554 | int stamp = uidgen.generate(); |
555 | 555 | ||
556 | QString newStamp = QString::number( stamp ); // generates newtime Stamp | 556 | QString newStamp = QString::number( stamp ); // generates newtime Stamp |
557 | StorageInfo storage; | 557 | StorageInfo storage; |
558 | const QList<FileSystem> &fileSystems = storage.fileSystems(); | 558 | const QList<FileSystem> &fileSystems = storage.fileSystems(); |
@@ -591,7 +591,7 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global:: | |||
591 | delete tmp; | 591 | delete tmp; |
592 | } | 592 | } |
593 | } | 593 | } |
594 | } | 594 | } |
595 | } | 595 | } |
596 | } | 596 | } |
597 | m_timeStamp = newStamp; | 597 | m_timeStamp = newStamp; |
@@ -687,7 +687,7 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data) | |||
687 | MRUList::removeTask( app ); | 687 | MRUList::removeTask( app ); |
688 | }else if ( msg == "linkChanged(QString)" ) { | 688 | }else if ( msg == "linkChanged(QString)" ) { |
689 | QString link; | 689 | QString link; |
690 | stream >> link; | 690 | stream >> link; |
691 | if ( in_lnk_props ) { | 691 | if ( in_lnk_props ) { |
692 | got_lnk_change = TRUE; | 692 | got_lnk_change = TRUE; |
693 | lnk_change = link; | 693 | lnk_change = link; |
@@ -741,34 +741,48 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data) | |||
741 | // register an app for autostart | 741 | // register an app for autostart |
742 | // if clear is send the list is cleared. | 742 | // if clear is send the list is cleared. |
743 | } else if ( msg == "autoStart(QString)" ) { | 743 | } else if ( msg == "autoStart(QString)" ) { |
744 | QString appName; | 744 | QString appName; |
745 | stream >> appName; | 745 | stream >> appName; |
746 | Config cfg( "autostart" ); | 746 | Config cfg( "autostart" ); |
747 | cfg.setGroup( "AutoStart" ); | 747 | cfg.setGroup( "AutoStart" ); |
748 | if ( appName.compare("clear") == 0){ | 748 | if ( appName.compare("clear") == 0){ |
749 | cfg.writeEntry("Apps", ""); | 749 | cfg.writeEntry("Apps", ""); |
750 | } | 750 | } |
751 | } else if ( msg == "autoStart(QString,QString)" ) { | 751 | } else if ( msg == "autoStart(QString,QString)" ) { |
752 | QString modifier, appName; | 752 | QString modifier, appName; |
753 | stream >> modifier >> appName; | 753 | stream >> modifier >> appName; |
754 | Config cfg( "autostart" ); | 754 | Config cfg( "autostart" ); |
755 | cfg.setGroup( "AutoStart" ); | 755 | cfg.setGroup( "AutoStart" ); |
756 | if ( modifier.compare("add") == 0 ){ | 756 | if ( modifier.compare("add") == 0 ){ |
757 | // only add it appname is entered | 757 | // only add if appname is entered |
758 | if (!appName.isEmpty()) { | 758 | if (!appName.isEmpty()) { |
759 | cfg.writeEntry("Apps", appName); | 759 | cfg.writeEntry("Apps", appName); |
760 | } | 760 | } |
761 | } else if (modifier.compare("remove") == 0 ) { | 761 | } else if (modifier.compare("remove") == 0 ) { |
762 | // need to change for multiple entries | 762 | // need to change for multiple entries |
763 | // actually remove is right now simular to clear, but in future there | 763 | // actually remove is right now simular to clear, but in future there |
764 | // should be multiple apps in autostart possible. | 764 | // should be multiple apps in autostart possible. |
765 | QString checkName; | 765 | QString checkName; |
766 | checkName = cfg.readEntry("Apps", ""); | 766 | checkName = cfg.readEntry("Apps", ""); |
767 | if (checkName == appName) { | 767 | if (checkName == appName) { |
768 | cfg.writeEntry("Apps", ""); | 768 | cfg.writeEntry("Apps", ""); |
769 | } | 769 | } |
770 | } | 770 | } |
771 | } else if ( msg == "sendCardInfo()" ) { | 771 | // case the autostart feature should be delayed |
772 | } else if ( msg == "autoStart(QString, QString, QString)") { | ||
773 | QString modifier, appName, delay; | ||
774 | stream >> modifier >> appName >> delay; | ||
775 | Config cfg( "autostart" ); | ||
776 | cfg.setGroup( "AutoStart" ); | ||
777 | if ( modifier.compare("add") == 0 ){ | ||
778 | // only add it appname is entered | ||
779 | if (!appName.isEmpty()) { | ||
780 | cfg.writeEntry("Apps", appName); | ||
781 | cfg.writeEntry("Delay", delay); | ||
782 | } | ||
783 | } else { | ||
784 | } | ||
785 | } else if ( msg == "sendCardInfo()" ) { | ||
772 | QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" ); | 786 | QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" ); |
773 | const QList<FileSystem> &fs = storage->fileSystems(); | 787 | const QList<FileSystem> &fs = storage->fileSystems(); |
774 | QListIterator<FileSystem> it ( fs ); | 788 | QListIterator<FileSystem> it ( fs ); |
@@ -823,7 +837,7 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data) | |||
823 | syncDialog->showMaximized(); | 837 | syncDialog->showMaximized(); |
824 | syncDialog->whatLabel->setText( "<b>" + what + "</b>" ); | 838 | syncDialog->whatLabel->setText( "<b>" + what + "</b>" ); |
825 | connect( syncDialog->buttonCancel, SIGNAL( clicked() ), | 839 | connect( syncDialog->buttonCancel, SIGNAL( clicked() ), |
826 | SLOT( cancelSync() ) ); | 840 | SLOT( cancelSync() ) ); |
827 | } | 841 | } |
828 | else if ( msg == "stopSync()") { | 842 | else if ( msg == "stopSync()") { |
829 | delete syncDialog; syncDialog = 0; | 843 | delete syncDialog; syncDialog = 0; |
@@ -862,7 +876,7 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data) | |||
862 | //qDebug( "sending length %d", contents.length() ); | 876 | //qDebug( "sending length %d", contents.length() ); |
863 | QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" ); | 877 | QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" ); |
864 | e << contents; | 878 | e << contents; |
865 | 879 | ||
866 | qDebug( "================ \n\n%s\n\n===============", | 880 | qDebug( "================ \n\n%s\n\n===============", |
867 | contents.latin1() ); | 881 | contents.latin1() ); |
868 | 882 | ||