Junior Job - option to choose between 'WLAN Interface' and 'wlan0' in UI

Will Stephenson wstephenson at kde.org
Mon Sep 28 13:42:50 CEST 2009


On Monday 28 September 2009 10:21:46 rahman duran wrote:
> Sorry for such noise, silly me :) Don't pay attention.

Fixed it yourself?  Good good.

Will

> On Sun, Sep 27, 2009 at 7:24 PM, rahman duran 
<a.rahman.duran at gmail.com>wrote:
> > Hi,
> >
> > Sorry, I had no internet connection because Vodafone TR's systems had
> > serious damage with the flood disaster in İstanbul, as I use gprs/3g to
> > connect. So I just able to look at this.
> >
> > I have some problem here;
> >
> > WiredWidget::WiredWidget(Knm::Connection * connection, QWidget * parent)
> >
> > : SettingWidget(connection, parent), d(new WiredWidget::Private)
> >
> > {
> >     d->ui.setupUi(this);
> >     d->setting = static_cast<Knm::WiredSetting
> > *>(connection->setting(Knm::Setting::Wired));
> >     d->ui.mtu->setSuffix(ki18np(" byte", " bytes"));
> >     foreach (Solid::Control::NetworkInterface * iface,
> > Solid::Control::NetworkManager::networkInterfaces()) {
> >         if (iface->type() == Solid::Control::NetworkInterface::Ieee8023)
> > { Solid::Device * dev = new Solid::Device(iface->uni()); QString
> > deviceText;
> >
> > KNetworkManagerServicePrefs::instance(Knm::ConnectionPersistence::NETWORK
> >MANAGEMENT_RCFILE);
> >
> >             if
> > (!KNetworkManagerServicePrefs::self()->useTechnicalNames()) {
> >
> > #if KDE_IS_VERSION(4,3,60)
> >                 deviceText = dev->description();
> > #else
> >                 deviceText = dev->product();
> > #endif
> >             } else {
> >                 Solid::Control::NetworkInterface * iface =
> > Solid::Control::NetworkManager::findNetworkInterface(iface->uni());
> >                 if (iface) {
> >                     deviceText = iface->interfaceName();
> >                 }
> >             }
> >
> >             Solid::Control::WiredNetworkInterface * wired =
> > static_cast<Solid::Control::WiredNetworkInterface*>(iface);
> >             d->ui.cmbMacAddress->addItem(i18nc("@item:inlist Solid Device
> > Name (kernel interface name)", "%1 (%2)", deviceText,
> > wired->interfaceName()), wired->hardwareAddress().toLatin1());
> >         }
> >     }
> > }
> >
> >
> >
> > It crashes with this line: Solid::Control::NetworkInterface * iface =
> > Solid::Control::NetworkManager::findNetworkInterface(iface->uni());
> >
> > here is backtrace:
> >
> > Application: KDE Control Module (kdeinit4), signal: Segmentation fault
> >
> > [KCrash Handler]
> >
> > #6 0xb1f9a194 in ?? () from /usr/lib/libsolidcontrol.so.4
> >
> > #7 0xb1fa3b53 in Solid::Control::NetworkInterface::uni() const () from
> > /usr/lib/libsolidcontrol.so.4
> >
> > #8 0xb202d66a in WiredWidget::WiredWidget (this=0x825e6d8,
> > connection=0x8288238, parent=0x8270858) at
> > /home/rahman/kde/sources/trunk/networkmanager/libs/ui/wiredwidget.cpp:72
> >
> > #9 0xb204dce9 in WiredPreferences::WiredPreferences (this=0x8270858,
> > parent=0xbfc90680, args=...) at
> > /home/rahman/kde/sources/trunk/networkmanager/libs/ui/wiredpreferences.cp
> >p:48
> >
> > #10 0xb204f746 in ConnectionEditor::editorForConnectionType
> > (this=0x80f0090, setDefaults=false, parent=0xbfc90680, type=Wired,
> > args=...)
> >
> > at
> > /home/rahman/kde/sources/trunk/networkmanager/libs/ui/connectioneditor.cp
> >p:139
> >
> > #11 0xb204f2f9 in ConnectionEditor::addConnection (this=0x80f0090,
> > useDefaults=false, type=Wired, otherArgs=...) at
> > /home/rahman/kde/sources/trunk/networkmanager/libs/ui/connectioneditor.cp
> >p:93
> >
> > #12 0xb2073c16 in ManageConnectionWidget::addClicked (this=0x8238d20) at
> > /home/rahman/kde/sources/trunk/networkmanager/settings/config/manageconne
> >ctionwidget.cpp:255
> >
> > #13 0xb2071665 in ManageConnectionWidget::qt_metacall (this=0x8238d20,
> > _c=InvokeMetaMethod, _id=3, _a=0xbfc90838)
> >
> > at
> > /home/rahman/kde/build/trunk/networkmanager/settings/config/moc_managecon
> >nectionwidget.cpp:86
> >
> > #14 0xb7f4c324 in QMetaObject::activate(QObject*, int, int, void**) ()
> > from /usr/lib/libQtCore.so.4
> >
> > #15 0xb7f4c801 in QMetaObject::activate(QObject*, QMetaObject const*,
> > int, int, void**) () from /usr/lib/libQtCore.so.4
> >
> > #16 0xb71654b5 in QAbstractButton::clicked(bool) () from
> > /usr/lib/libQtGui.so.4
> >
> > #17 0xb6e7d2fd in ?? () from /usr/lib/libQtGui.so.4
> >
> > #18 0xb6e7f03b in ?? () from /usr/lib/libQtGui.so.4
> >
> > #19 0xb6e7f2d6 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) ()
> > from /usr/lib/libQtGui.so.4
> >
> > #20 0xb6b30bec in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
> >
> > #21 0xb6e7d190 in QAbstractButton::event(QEvent*) () from
> > /usr/lib/libQtGui.so.4
> >
> > #22 0xb6f2a333 in QPushButton::event(QEvent*) () from
> > /usr/lib/libQtGui.so.4
> >
> > #23 0xb6ad994c in QApplicationPrivate::notify_helper(QObject*, QEvent*)
> > () from /usr/lib/libQtGui.so.4
> >
> > #24 0xb6ae1c0b in QApplication::notify(QObject*, QEvent*) () from
> > /usr/lib/libQtGui.so.4
> >
> > #25 0xb7519301 in KApplication::notify(QObject*, QEvent*) () from
> > /usr/lib/libkdeui.so.5
> >
> > #26 0xb7f35e3e in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
> > from /usr/lib/libQtCore.so.4
> >
> > #27 0xb6ae0c2c in QApplicationPrivate::sendMouseEvent(QWidget*,
> > QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&) () from
> > /usr/lib/libQtGui.so.4
> >
> > #28 0xb6b5183a in ?? () from /usr/lib/libQtGui.so.4
> >
> > #29 0xb6b50dae in QApplication::x11ProcessEvent(_XEvent*) () from
> > /usr/lib/libQtGui.so.4
> >
> > #30 0xb6b7bb08 in ?? () from /usr/lib/libQtGui.so.4
> >
> > #31 0xb66b4442 in g_main_context_dispatch () from
> > /usr/lib/libglib-2.0.so.0
> >
> > #32 0xb66b7d18 in ?? () from /usr/lib/libglib-2.0.so.0
> >
> > #33 0xb66b7e3e in g_main_context_iteration () from
> > /usr/lib/libglib-2.0.so.0
> >
> > #34 0xb7f61aa8 in
> > QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>
> >) () from /usr/lib/libQtCore.so.4
> >
> > #35 0xb6b7b23a in ?? () from /usr/lib/libQtGui.so.4
> >
> > #36 0xb7f3445d in
> > QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from
> > /usr/lib/libQtCore.so.4
> >
> > #37 0xb7f348a9 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
> > () from /usr/lib/libQtCore.so.4
> >
> > #38 0xb6fba621 in QDialog::exec() () from /usr/lib/libQtGui.so.4
> >
> > #39 0xb5be714b in kdemain () from /usr/lib/libkdeinit4_kcmshell4.so
> >
> > #40 0x0804e147 in _start ()
> >
> >
> >
> >
> >
> > iface()->uni() returns "
> >
> > /org/freedesktop/Hal/devices/net_00_24_8c_5f_40_a5
> > "
> >
> > Any clue that why Solid crashs?
> >
> > 2009/9/15 Will Stephenson <wstephenson at kde.org>
> >
> >>  http://bugs.kde.org/show_bug.cgi?id=207445 :
> >>
> >> Some users prefer descriptive names eg 'Wireless Interface', others
> >> prefer
> >>
> >> technical names eg 'eth0, wlan0'.  This junior-job is about making it
> >> possible
> >>
> >> to choose.
> >>
> >>  The different styles are illustrated in the UnconfiguredInterfaceItem
> >>
> >> constructor in monolithic/unconfiguredinterfaceitem.cpp
> >>
> >>  /org/freedesktop/Hal/devices/net_00_24_8c_5f_40_a5
> >>
> >>  For this job you would have to
> >>
> >>  1) extend KNetworkManagerServicePrefs (via
> >> libs/internals/knmserviceprefs.kcfg)
> >>
> >> to store this preference
> >>
> >>  2) provide a checkbox somewhere in settings/config/traysettings.ui and
> >>
> >> settings/config/managetraywidget.cpp to control this setting
> >>
> >>  3) use this setting throughout monolithic and libs/ui to show either
> >> the
> >>
> >> Solid::Device description or interface name.  At some points in the code
> >> I have
> >>
> >> already provided an if clause to do this, see UnconfiguredInterfaceItem
> >> as
> >>
> >> above.  You can probably find all the places to change by grepping for
> >>
> >> Solid::Device.
> >>
> >> As usual, ask here or on IRC (wstephenson in #solid) for advice on this
> >> JJ.
> >>
> >>  Will
> >>
> >>
> >> _______________________________________________
> >> kde-networkmanager mailing list
> >> kde-networkmanager at kde.org
> >> https://mail.kde.org/mailman/listinfo/kde-networkmanager
> >
> > --
> > Rahman Duran
> >
> > Software Engineer, Turkey
> 


More information about the kde-networkmanager mailing list