equal
deleted
inserted
replaced
18 #include <QString> |
18 #include <QString> |
19 #include <QLocale> |
19 #include <QLocale> |
20 #include <QApplication> |
20 #include <QApplication> |
21 #include "usbindicator.h" |
21 #include "usbindicator.h" |
22 #include "usbaddressedindicator.h" |
22 #include "usbaddressedindicator.h" |
|
23 #include "usbmassstorageindicator.h" |
|
24 #include "usbdisconnectingindicator.h" |
|
25 #include "usbdebug.h" |
23 |
26 |
24 Q_EXPORT_PLUGIN(UsbIndicatorPlugin) |
27 Q_EXPORT_PLUGIN(UsbIndicatorPlugin) |
25 |
28 |
26 /*! |
29 /*! |
27 UsbIndicatorPlugin::UsbIndicatorPlugin |
30 UsbIndicatorPlugin::UsbIndicatorPlugin |
44 UsbIndicatorPlugin::indicatorTypes |
47 UsbIndicatorPlugin::indicatorTypes |
45 Return notification types this plugin implements |
48 Return notification types this plugin implements |
46 */ |
49 */ |
47 QStringList UsbIndicatorPlugin::indicatorTypes() const |
50 QStringList UsbIndicatorPlugin::indicatorTypes() const |
48 { |
51 { |
|
52 myDebug() << ">>> UsbIndicatorPlugin::indicatorTypes"; |
49 QStringList types; |
53 QStringList types; |
50 types << ConnectedIndicator; |
54 types << ConnectedIndicator; |
51 types << AddressedIndicator; |
55 types << AddressedIndicator; |
|
56 types << MassStorageIndicator; |
|
57 types << UsbDisconnectingIndicator; |
52 return types; |
58 return types; |
53 } |
59 } |
54 |
60 |
55 |
61 |
56 |
62 |
58 UsbIndicatorPlugin::createIndicator |
64 UsbIndicatorPlugin::createIndicator |
59 Creates and returns the HbIndicatorInterface |
65 Creates and returns the HbIndicatorInterface |
60 */ |
66 */ |
61 HbIndicatorInterface* UsbIndicatorPlugin::createIndicator(const QString &indicatorType) |
67 HbIndicatorInterface* UsbIndicatorPlugin::createIndicator(const QString &indicatorType) |
62 { |
68 { |
|
69 myDebug() << ">>> UsbIndicatorPlugin::createIndicator"; |
63 if (!mTranslatorLoaded) { |
70 if (!mTranslatorLoaded) { |
64 // add translator for application library |
71 // add translator for application library |
65 QString locale = QLocale::system().name(); |
72 QString locale = QLocale::system().name(); |
66 QString filename = QString("usbindimenu_") + locale; |
73 QString filename = QString("usbindimenu_") + locale; |
67 bool success = mTranslator.load(filename, QString("z:/resource/qt/translations")); |
74 bool success = mTranslator.load(filename, QString("z:/resource/qt/translations")); |
74 indicator = new USBIndicator(indicatorType); |
81 indicator = new USBIndicator(indicatorType); |
75 } |
82 } |
76 else if (indicatorType == AddressedIndicator) { |
83 else if (indicatorType == AddressedIndicator) { |
77 indicator = new UsbAddressedIndicator(indicatorType); |
84 indicator = new UsbAddressedIndicator(indicatorType); |
78 } |
85 } |
|
86 else if (indicatorType == MassStorageIndicator) { |
|
87 indicator = new UsbMassStorageIndicator(indicatorType); |
|
88 } |
|
89 else if (indicatorType == UsbDisconnectingIndicator) { |
|
90 indicator = new USBDisconnectingIndicator(indicatorType); |
|
91 } |
|
92 myDebug() << "<<< UsbIndicatorPlugin::createIndicator"; |
79 return indicator; |
93 return indicator; |
80 } |
94 } |
81 |
95 |
82 |
96 |