KDE/kdevplatform

Andreas Pakulat apaku at gmx.de
Sun Apr 5 10:35:40 UTC 2009


On 05.04.09 01:18:29, David Nolden wrote:
> Am Sonntag 05 April 2009 00:27:03 schrieb Andreas Pakulat:
> > >  public Q_SLOTS:
> > >      /**
> > > +     * Tries finding a project-file for the given source-url and opens
> > > it. +     * If no .kdev4 project file is found, the user is asked to
> > > import a project. +     */
> > > +        virtual void openProjectForUrl( const KUrl &sourceUrl ) = 0;
> >
> > What is this member for? All the functionality is inside shell so I
> > currently don't see the need for this in the public API.
> The basic motivation to create this was for the assistant, and I have already 
> code for that sitting on my disk.

Ah, ok.
 
> > > @@ -354,6 +356,11 @@
> > >      d->m_recentAction->setWhatsThis(
> > >          i18n( "<b>Open recent project</b><p>Opens recently opened
> > > project.</p>" ) ); d->m_recentAction->loadEntries( KConfigGroup(config,
> > > "RecentProjects") ); +
> > > +    KAction* openProjectForFileAction = new KAction( this );
> > > +    ac->addAction("project_open_for_file", openProjectForFileAction);
> > > +    openProjectForFileAction->setText("Open Project for Current File");
> > > +    connect( openProjectForFileAction, SIGNAL(triggered(bool)),
> > > SLOT(openProjectForUrlSlot(bool)));
> >
> > There's also a signal without bool parameter, could it be that this is a
> > bug in kdev4's signal/slot auto-completion ;)
> Well, no, from what I see there isn't, neither in QAction nor in KAction.

Ah, right, no overload, but the parameter is optional (i.e. has a default
value) and in that case you can leave it out from the signal and the
slot. The attached example compiles and runs just fine :)

Andreas

-- 
Excellent time to become a missing person.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c++src
Size: 507 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20090405/310e5f7f/attachment.cpp>
-------------- next part --------------
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>MainWindow</class>
 <widget class="QMainWindow" name="MainWindow">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>800</width>
    <height>600</height>
   </rect>
  </property>
  <property name="windowTitle">
   <string>MainWindow</string>
  </property>
  <widget class="QWidget" name="centralwidget">
   <layout class="QGridLayout" name="gridLayout">
    <item row="0" column="0">
     <widget class="QLabel" name="label">
      <property name="text">
       <string>Hello World</string>
      </property>
     </widget>
    </item>
   </layout>
  </widget>
  <widget class="QMenuBar" name="menubar">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>800</width>
     <height>27</height>
    </rect>
   </property>
   <widget class="QMenu" name="menuFile">
    <property name="title">
     <string>File</string>
    </property>
    <addaction name="actionNew"/>
   </widget>
   <addaction name="menuFile"/>
  </widget>
  <widget class="QStatusBar" name="statusbar"/>
  <action name="actionNew">
   <property name="text">
    <string>New</string>
   </property>
  </action>
 </widget>
 <resources/>
 <connections/>
</ui>


More information about the KDevelop-devel mailing list