Bug 74724 - automake manager: "data in noinst" only displayed when other target is available also
Summary: automake manager: "data in noinst" only displayed when other target is availa...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Build tools: Automake (show other bugs)
Version: 3.0.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-09 17:32 UTC by Daniel Franke
Modified: 2006-10-21 03:30 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Franke 2004-02-09 17:32:44 UTC
Version:           3.0.0 (using KDE 3.2.0, SuSE)
Compiler:          gcc version 3.3 20030226 (prerelease) (SuSE Linux)
OS:          Linux (i686) release 2.4.20-4GB

* add a new subproject foo
 * add a new Target "Data File" in "noinst" in foo, say bar
 --> 'bar' not listed

 * add a "program" in "bin", foobar
 --> 'foobar' and 'bar' are listed

 * remove target 'foobar'
 --> 'bar' disappears also
Comment 1 Sascha Cunz 2004-02-17 08:19:22 UTC
This is ugly behaviour, indeed.
Comment 2 Daniel Franke 2005-01-14 14:51:39 UTC
Still valid in kdevelop-3.1.91, KDE-3.3.91, CVS 050113
Comment 3 Matt Rogers 2006-10-21 03:30:47 UTC
SVN commit 597620 by mattr:

Commit patch from Megan Webb to fix bug 74724. Add data to the noinst
target correctly when there are no other targets

Thanks for the patch!
CCMAIL: mwebb@unwired.com.au
BUG: 74724


 M  +8 -23     addtargetdlg.cpp  
 M  +1 -4      autoprojectwidget.cpp  


--- branches/kdevelop/3.4/buildtools/autotools/addtargetdlg.cpp #597619:597620
@@ -141,23 +141,6 @@
 	default: ;
 	}
 
-	if (primary == "DATA"){
-	    // DATA does not need a name; DATA may already exist.
-	    TargetItem *titem = m_widget->createTargetItem(name, prefix, primary, true);
-	    QPtrListIterator<TargetItem> it( m_subproject->targets );
-	    for( ; it.current(); ++it ){
-		if( (*it)->text(0) == titem->text(0) ){
-		    /// \FIXME Add message box here, after string-freeze is over
-		    ///        something like: "This data target already exists."
-		    QDialog::accept();
-		    return;
-		}
-	    }
-	    m_subproject->targets.append( titem );
-	    QDialog::accept();
-	    return;
-	}
-
 	if (name.isEmpty()) {
 		KMessageBox::sorry(this, i18n("You have to give the target a name"));
 		return;
@@ -219,12 +202,14 @@
 
 	QMap<QString,QString> replaceMap;
 
-        if( primary == "PROGRAMS" || primary == "LIBRARIES" || primary == "LTLIBRARIES" ){
-	    QString varname = prefix + "_" + primary;
-	    m_subproject->variables[varname] += (" " + name);
-	    replaceMap.insert(varname, m_subproject->variables[varname]);
-            replaceMap.insert(canonname + "_SOURCES", "");
-        }
+	if( primary == "PROGRAMS" || primary == "LIBRARIES" || primary == "LTLIBRARIES" || primary == "DATA"  ){
+		QString varname = prefix + "_" + primary;
+		m_subproject->variables[varname] += (" " + name);
+		replaceMap.insert(varname, m_subproject->variables[varname]);
+		if ( primary != "DATA" ){
+			replaceMap.insert(canonname + "_SOURCES", "");
+		}
+	}
 	if (primary == "LTLIBRARIES" || primary == "PROGRAMS")
             replaceMap.insert(canonname + "_LDFLAGS", ldflags);
 
--- branches/kdevelop/3.4/buildtools/autotools/autoprojectwidget.cpp #597619:597620
@@ -585,18 +585,15 @@
                                                  const QString &prefix, const QString &primary,
                                                  bool take )
 {
-	bool group = !( primary == "PROGRAMS" || primary == "LIBRARIES"
-	                || primary == "LTLIBRARIES" || primary == "JAVA" );
 	bool docgroup = ( primary == "KDEDOCS" );
 	bool icongroup = ( primary == "KDEICON" );
+	bool group = !(docgroup || icongroup);
 
 	QString text;
 	if ( docgroup )
 		text = i18n( "Documentation data" );
 	else if ( icongroup )
 		text = i18n( "KDE Icon data" ).arg( prefix );
-	else if ( group )
-		text = i18n( "%1 in %2" ).arg( nicePrimary( primary ) ).arg( prefix );
 	else
 		text = i18n( "%1 (%2 in %3)" ).arg( name ).arg( nicePrimary( primary ) ).arg( prefix );